File discord of Package discord
#!/bin/bash
#in the file $HOME/.config/discord/settings.json
#if the setting SKIP_HOST_UPDATE does not exist add it
#otherwise leave it untouched
CONFIGFILE=$HOME/.config/discord/settings.json
EXE=$(dirname "$0")/../lib64/discord/Discord
if [[ -x $EXE ]]; then
if [[ -d $HOME/.config && ! -f $CONFIGFILE ]]; then
[[ ! -d $HOME/.config/discord ]] && mkdir $HOME/.config/discord
echo '{"SKIP_HOST_UPDATE": true}' >$CONFIGFILE
elif [[ -f $CONFIGFILE ]]; then
! grep -qF SKIP_HOST_UPDATE $CONFIGFILE && \
sed -i '/^{/s@$@\n "SKIP_HOST_UPDATE": true,@' $CONFIGFILE
fi
export XDG_SESSION_TYPE=x11
exec $EXE "$@"
fi