arch-packages/discord-electron-openasar/discord-launcher.sh
Manuel d5513a1e94
upgpkg: discord-electron-openasar 0.0.27+809-3
Fix whitespace indentation in install file
Replace ignore-gpu-blacklist with ignore-gpu-blocklist as the former does not work anymore
2023-05-27 21:55:29 +02:00

29 lines
607 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
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
mapfile -t < "${flags_file}"
else
cat > "${flags_file}" <<EOF
#--ignore-gpu-blocklist
#--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[@]}" "$@"