fix(config): give cron-started Steam the desktop session env

Steam has no autostart on nik-gpu, so after a reboot the first cron run
starts it, and every game Steam launches inherits that environment.
cron sets neither XDG_RUNTIME_DIR nor DBUS_SESSION_BUS_ADDRESS, so the
Pulse socket never got mounted into the Proton container. Persona 3
Reload then fell back to ALSA and crashed on launch in xaudio2_9.

Set both in config.ENV, which launch_game() passes down to Steam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nik Afiq 2026-11-06 21:11:43 +09:00
parent 598e1ef65b
commit 9cfc41b384

View File

@ -3,7 +3,21 @@ import os
DISPLAY = ":0"
XAUTHORITY = "/run/user/1000/gdm/Xauthority"
ENV = {**os.environ, "DISPLAY": DISPLAY, "XAUTHORITY": XAUTHORITY}
# Steam has no autostart here, so after a reboot it's the first cron run that
# starts it, and every game Steam launches inherits that environment. cron
# sets neither of these. Real incident (2026-11-06): without XDG_RUNTIME_DIR,
# the Pulse socket never got mounted into the Proton container, so Persona 3
# Reload fell back to ALSA and crashed on launch in xaudio2_9 until Steam was
# restarted from the desktop.
XDG_RUNTIME_DIR = "/run/user/1000"
DBUS_SESSION_BUS_ADDRESS = f"unix:path={XDG_RUNTIME_DIR}/bus"
ENV = {
**os.environ,
"DISPLAY": DISPLAY,
"XAUTHORITY": XAUTHORITY,
"XDG_RUNTIME_DIR": XDG_RUNTIME_DIR,
"DBUS_SESSION_BUS_ADDRESS": DBUS_SESSION_BUS_ADDRESS,
}
WINDOW_NAME = "BlueArchive"