feat: add firstboot warning to users with polaris gpus (#1277)

Only triggers if `/usr/libexec/bazzite-sdl-gpu-warn` exists (only does on handheld images)
also triggers on any gpus defined in `/usr/libexec/gamescope-sdl-workaround`
This commit is contained in:
HikariKnight 2024-06-25 16:59:53 +02:00 committed by GitHub
parent c70ccbd174
commit 7848f42799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,38 @@
#!/usr/bin/bash
# The file to use for tracking if the warning has been shown
ACCEPTED="$HOME/.config/bazzite/gamescope-sdl-accepted"
# Check if the check has already run
if [ -f "$ACCEPTED" ]; then
# Exit if user has already aknowledged the warning
exit 0
fi
# Show the SDL workaround warning if required
if /usr/libexec/gamescope-sdl-workaround; then
# Add 4 spaces if you want to start a new line,
# it makes the text easier to read in the dialog.
zenity --text-info --title="WARNING: Problematic GPU detected!" --checkbox="Understood, I made sure to have a controller connected." --width 560 --height 430 <<< "
This GPU requires a workaround to work in Game Mode Session!
It is applied automatically, however it means that
keyboard and mouse will not work AT ALL when using
Game Mode Session (Desktop Mode will not be affected)
Please pair at least 1 bluetooth controller to the system now
so you can navigate Steam Game Mode.
If you plan to use a wired controller or one with a non
bluetooth dongle, verify it is detected in Steam BEFORE rebooting!"
# If the user mark the checkbox and clicks OK
# shellcheck disable=SC2181
if [ "$?" == "0" ]; then
# Make the .config/bazzite folder if needed
if [ ! -d "$HOME/.config/bazzite" ]; then
mkdir "$HOME/.config/bazzite/"
fi
# Mark that the user has acknowledged the warning
touch "$ACCEPTED"
fi
fi

View File

@ -1,4 +1,11 @@
#!/usr/bin/bash
# Show a warning to people that need gamescope-sdl-workaround
# Only runs if the script file from the deck image exists
if [ -f "/usr/libexec/bazzite-sdl-gpu-warn" ]; then
# This will only show a warning if the user has not accepted the warning
/usr/libexec/bazzite-sdl-gpu-warn &
fi
# Simply launches the "yafti" GUI with the uBlue image's configuration.
/usr/bin/yafti /usr/share/ublue-os/firstboot/yafti.yml