bazzite-steam-bpm races waitpid against Steam PIDs that may already be gone when quitting a lingering instance, and its `if ! waitpid` clobbers $? so every failure reports code=0 via zenity. Replace the call with our own quit-and-wait (pgrep scoped to the kid's uid) and launch bazzite-steam steam://open/bigpicture directly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21 lines
849 B
Bash
21 lines
849 B
Bash
#!/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
|
|
|
|
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
|