diff options
author | Zoddo | 2022-09-15 19:43:31 +0200 |
---|---|---|
committer | Zoddo | 2022-09-15 19:43:31 +0200 |
commit | b5ef7d2c84fe574725be80ab3bc84297f05f9265 (patch) | |
tree | 0f93e344663eacef07d47990d2ae68f6a3ec02c1 /discord-launcher.sh | |
parent | bcc0ab79b8cb88abb7c49e0cde8a433f4f8e88da (diff) | |
download | aur-b5ef7d2c84fe574725be80ab3bc84297f05f9265.tar.gz |
discord 0.0.20-1: new upstream version, add support for discord-flags.conf
Diffstat (limited to 'discord-launcher.sh')
-rwxr-xr-x | discord-launcher.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/discord-launcher.sh b/discord-launcher.sh new file mode 100755 index 000000000000..f77856874a4f --- /dev/null +++ b/discord-launcher.sh @@ -0,0 +1,21 @@ +#!/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[@]}" "$@" |