Skip to content

Commit 0526da5

Browse files
HikariKnightKyleGospo
authored andcommitted
feat: add firstboot warning to users with polaris gpus
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`
1 parent f6e6619 commit 0526da5

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/bash
2+
3+
# The file to use for tracking if the warning has been shown
4+
ACCEPTED="$HOME/.config/bazzite/gamescope-sdl-accepted"
5+
6+
# Check if the check has already run
7+
if [ -f "$ACCEPTED" ]; then
8+
# Exit if user has already aknowledged the warning
9+
exit 0
10+
fi
11+
12+
# Show the SDL workaround warning if required
13+
if /usr/libexec/gamescope-sdl-workaround; then
14+
# Add 4 spaces if you want to start a new line,
15+
# it makes the text easier to read in the dialog.
16+
zenity --text-info --title="WARNING: Problematic GPU detected!" --checkbox="Understood, I made sure to have a controller connected." --width 560 --height 430 <<< "
17+
This GPU requires a workaround to work in Game Mode Session!
18+
It is applied automatically, however it means that
19+
keyboard and mouse will not work AT ALL when using
20+
Game Mode Session (Desktop Mode will not be affected)
21+
22+
Please pair at least 1 bluetooth controller to the system now
23+
so you can navigate Steam Game Mode.
24+
25+
If you plan to use a wired controller or one with a non
26+
bluetooth dongle, verify it is detected in Steam BEFORE rebooting!"
27+
28+
# If the user mark the checkbox and clicks OK
29+
# shellcheck disable=SC2181
30+
if [ "$?" == "0" ]; then
31+
# Make the .config/bazzite folder if needed
32+
if [ ! -d "$HOME/.config/bazzite" ]; then
33+
mkdir "$HOME/.config/bazzite/"
34+
fi
35+
# Mark that the user has acknowledged the warning
36+
touch "$ACCEPTED"
37+
fi
38+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/usr/bin/bash
22

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

0 commit comments

Comments
 (0)