2023-05-27 20:10:10 +02:00
|
|
|
#!/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
|
2023-05-28 23:55:25 +02:00
|
|
|
grep -q '\--ignore-gpu-blacklist' "${flags_file}" && \
|
|
|
|
sed -i "s|--ignore-gpu-blacklist|--ignore-gpu-blocklist|" "${flags_file}"
|
2023-05-27 20:10:10 +02:00
|
|
|
mapfile -t < "${flags_file}"
|
|
|
|
else
|
|
|
|
cat > "${flags_file}" <<EOF
|
2023-05-27 21:55:10 +02:00
|
|
|
#--ignore-gpu-blocklist
|
2023-05-27 20:10:10 +02:00
|
|
|
#--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[@]}" "$@"
|