Files
a13labs.infra/ansible/files/game_station/bin/system/steamos-session-select
alexandre.pires b4f4fe2f07 Refactor SteamOS session management and launcher scripts
- Removed obsolete launch_desktop.sh and launch_session.sh scripts.
- Introduced new steam-launcher script to handle Steam launching and session tracking.
- Added steam-short-session-tracker for monitoring short Steam sessions and triggering repairs.
- Created steamos and steamos-session scripts for managing the SteamOS session.
- Implemented steamos-session-select for switching between Gamescope and Plasma sessions.
- Updated SDDM configuration for autologin and session management.
- Added new systemd services and targets for managing Gamescope and Steam sessions.
- Created desktop entries and icons for ALVR and SteamOS shortcuts.
- Enhanced logging and error handling across scripts.
- Cleaned up unused systemd slice and service files.
- Updated Ansible playbook to reflect new configurations and file structures.
2025-12-01 17:25:18 +01:00

40 lines
990 B
Bash

#!/bin/bash
set -euo pipefail
LOGFILE="$HOME/.local/logs/session.log"
log() { echo "[$(date --iso-8601=seconds)] $*" | tee -a "$LOGFILE"; }
die() { echo >&2 "!! $*"; exit 1; }
# File this script will modify
CONF_FILE="/etc/sddm.conf.d/zz-steamos-autologin.conf"
session="${1:-gamescope}"
case "$session" in
plasma*)
log "Plasma session selected."
touch "$HOME/.desktop-session-plasma"
;;
gamescope)
log "Gamescope session selected."
if [[ -f "$HOME/.desktop-session-plasma" ]]; then
rm "$HOME/.desktop-session-plasma"
fi
;;
*)
log "!! Unrecognized session '$session'"
exit 1
;;
esac
log "Signaling session switch..."
touch "$HOME/.steamos-session-switch"
# It is possible to get things remaining from the previous session if SDDM is sigkilled by root systemd
# and our units are still running in the user systemd
systemctl --user stop gamescope-session.target
systemctl --user stop plasma-workspace.target
systemctl --user reset-failed