feat: Refactor game station launch scripts and update session management

This commit is contained in:
2025-10-27 00:06:05 +01:00
parent adc893de6e
commit 49de842b57
8 changed files with 147 additions and 45 deletions
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
LOGFILE="$HOME/.local/logs/desktop.log"
log() { echo "[$(date --iso-8601=seconds)] $*" | tee -a "$LOGFILE"; }
log "Starting Desktop session..."
DESKTOP_SESSION_BIN="$(command -v startplasma-wayland || true)"
if [ -z "$DESKTOP_SESSION_BIN" ]; then
log "ERROR: startplasma-wayland not found in PATH"
exit 127
fi
log "Launching Desktop: $DESKTOP_SESSION_BIN"
exec "$DESKTOP_SESSION_BIN" >>"$LOGFILE" 2>&1 &
sleep 5
systemd-run --user --slice=sunshine.slice --scope sunshine >>"$LOGFILE" 2>&1 || {
log "ERROR: Failed to start Sunshine"
exit 1
} &
tail -f /dev/null