arch-packages/discord-launcher.sh

21 lines
419 B
Bash
Executable file

#!/usr/bin/bash
set -euo pipefail
name=discord
electron=@ELECTRON@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
declare -a flags
if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done
exec /usr/bin/${electron} /usr/lib/${name}/app.asar "${flags[@]}" "$@"