arch-packages/discord-electron-openasar/discord-launcher.sh
Manuel ca79b29c22
upgpkg: discord-electron-openasar 0.0.27+809-2
Update to latest OpenAsar commit
Update Discord launcher script (Original by Zoddo)
Add libxss as dependency to fix Discord corruption warning
Add install script to notify user about discord-flags.conf
Remove duplicate Path variable in .desktop file
Update contributor list
2023-05-27 20:10:31 +02:00

28 lines
532 B
Bash

#!/usr/bin/env bash
set -euo pipefail
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/@PKGNAME@-flags.conf"
declare -a flags
if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
else
cat > "${flags_file}" <<EOF
#--ignore-gpu-blacklist
#--enable-gpu-rasterization
#--enable-zero-copy
EOF
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
flags+=("${line}")
fi
done
exec /usr/bin/electron@ELECTRON@ \
/usr/lib/@PKGNAME@/app.asar \
--ozone-platform-hint=auto \
"${flags[@]}" "$@"