diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-09-13 13:58:34 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-09-13 13:58:34 +0800 |
| commit | 9f1490f28db8643e78cd26e3cd8f0c92909f16a2 (patch) | |
| tree | 5ce2d5c0642b73eeaf50f6e108e67ba7a65dc0ba /build_files/patch-bazzite-deck-identity.sh | |
| parent | c1c1027f3664db21397a7175465f31777b591504 (diff) | |
| download | AeroCore-OS-9f1490f28db8643e78cd26e3cd8f0c92909f16a2.tar.gz AeroCore-OS-9f1490f28db8643e78cd26e3cd8f0c92909f16a2.zip | |
Migrate legacy gaming mode shortcuttesting-44.20260913
Repair existing user desktop launchers that still reference the removed
return-to-gamemode systemd service.
Diffstat (limited to 'build_files/patch-bazzite-deck-identity.sh')
| -rwxr-xr-x | build_files/patch-bazzite-deck-identity.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build_files/patch-bazzite-deck-identity.sh b/build_files/patch-bazzite-deck-identity.sh index d3ee860..da2a74e 100755 --- a/build_files/patch-bazzite-deck-identity.sh +++ b/build_files/patch-bazzite-deck-identity.sh @@ -158,6 +158,29 @@ patch_desktop_branding_migration() { fi } +patch_gamemode_shortcut_migration() { + local file="$1" + local marker='AeroCore Return to Gaming Mode shortcut migration' + + if [[ ! -f "$file" ]]; then + echo "Unable to locate expected Bazzite user setup file: $file" >&2 + exit 1 + fi + + if grep -Fq "$marker" "$file"; then + return 0 + fi + + cat >> "$file" <<'EOF' + +# AeroCore Return to Gaming Mode shortcut migration +# Replace the legacy privileged systemd launcher left by older Bazzite images. +if [[ -f "$HOME/Desktop/Return.desktop" ]]; then + sed -i 's|^Exec=systemctl start return-to-gamemode\.service$|Exec=/usr/bin/return-to-gamemode|' "$HOME/Desktop/Return.desktop" +fi +EOF +} + # Keep AeroCore's public image-name, while restoring the Deck capability checks # used by Bazzite's runtime scripts. These are literal source lines; variable # expansion must happen later, when the scripts run on the installed system. @@ -197,3 +220,4 @@ patch_condition \ 3 patch_desktop_branding_migration "$(target_path /usr/libexec/bazzite-user-setup)" +patch_gamemode_shortcut_migration "$(target_path /usr/libexec/bazzite-user-setup)" |
