arch-packages/discord-launcher.sh

22 lines
455 B
Bash
Raw Normal View History

#!/usr/bin/bash
set -euo pipefail
2022-12-10 12:07:22 +01:00
name=@PKGNAME@
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
2023-07-11 23:50:05 +02:00
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then
flags+=("${line}")
fi
done
2023-10-17 18:44:23 +02:00
exec /usr/bin/${electron} /usr/share/${name}/resources/app.asar "${flags[@]}" "$@"