diff --git a/files/console/usr/bin/bc250-steam-bpm-autostart b/files/console/usr/bin/bc250-steam-bpm-autostart index 3ccf42b..eeed154 100644 --- a/files/console/usr/bin/bc250-steam-bpm-autostart +++ b/files/console/usr/bin/bc250-steam-bpm-autostart @@ -1,5 +1,20 @@ #!/usr/bin/env bash # Autostart Steam Big Picture Mode for the kid's account only. # Other accounts (parent, RDP admin sessions) get a normal desktop. +# +# Deliberately does NOT use bazzite-steam-bpm: that wrapper has a race +# (waits on Steam PIDs that may already be gone) plus a bash `! cmd` +# status-clobbering bug, producing a zenity "ERROR: code=0; This is +# strange..." popup at login whenever Steam lingered from a previous +# session. We do the same quit-first dance robustly instead. [ "$(id -un)" = "kid" ] || exit 0 -exec /usr/bin/bazzite-steam-bpm + +if pgrep -u "$(id -u)" -f 'steam\.sh|ubuntu12_32/steam' >/dev/null 2>&1; then + /usr/bin/steam +quit >/dev/null 2>&1 || true + for _ in $(seq 1 30); do + pgrep -u "$(id -u)" -f 'steam\.sh|ubuntu12_32/steam' >/dev/null 2>&1 || break + sleep 1 + done +fi + +exec /usr/bin/bazzite-steam steam://open/bigpicture