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.
This commit is contained in:
@@ -4,6 +4,11 @@ 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
|
||||
@@ -23,18 +28,12 @@ case "$session" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if systemctl --user is-active --quiet sunshine.scope; then
|
||||
log "Stopping sunshine.scope"
|
||||
systemctl --user stop sunshine.scope
|
||||
fi
|
||||
if systemctl --user is-active --quiet steam.scope; then
|
||||
log "Stopping steam.scope"
|
||||
systemctl --user stop steam.scope
|
||||
fi
|
||||
if systemctl --user is-active --quiet plasma.scope; then
|
||||
log "Stopping plasma.scope"
|
||||
systemctl --user stop plasma.scope
|
||||
fi
|
||||
sleep 5
|
||||
log "Restarting graphical session service..."
|
||||
systemctl --user restart session.service
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user