refactor: The session sync and kernel headers scripts in patches/

This commit is contained in:
theupriser committed 2026-09-27 15:59:17 +02:00
1 parent 0883e7a501
commit e2ad40dfb9
6 files changed
+36 -35

No files matched your search

+1 -18
View File
@@ -185,24 +185,7 @@ install_session_sync() {
local SYNC_SCRIPT="/usr/local/bin/sync-steamos-session.sh"
info "Installing session sync bridge at $SYNC_SCRIPT"
sudo tee "$SYNC_SCRIPT" > /dev/null << 'EOF'
#!/bin/bash
SRC="/etc/plasmalogin.conf.d/zz-steamos-autologin.conf"
DEST="/etc/plasmalogin.conf"
[[ -f "$SRC" ]] || exit 0
SESSION=$(grep -oP '^Session=\K.*' "$SRC")
[[ -z "$SESSION" ]] && exit 0
# Only touch Session= inside [Autologin]; other sections may have their own.
if sed -n '/^\[Autologin\]/,/^\[/p' "$DEST" | grep -q '^Session='; then
sed -i "/^\[Autologin\]/,/^\[/ s|^Session=.*|Session=$SESSION|" "$DEST"
elif grep -q '^\[Autologin\]' "$DEST"; then
sed -i "/^\[Autologin\]/a Session=$SESSION" "$DEST"
else
printf '\n[Autologin]\nSession=%s\n' "$SESSION" >> "$DEST"
fi
EOF
patch_file sync-steamos-session.sh | sudo tee "$SYNC_SCRIPT" > /dev/null
sudo chmod +x "$SYNC_SCRIPT"
ok "Sync script installed."