feat: Add scripts and systemd services for SteamOS session management and game launching
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user