mirror of
https://github.com/theupriser/steamify-cachyos.git
synced 2026-10-03 17:41:58 +02:00
refactor: The session sync and kernel headers scripts in patches/
This commit is contained in:
1 parent
0883e7a501
commit
e2ad40dfb9
6 files changed
+36
-35
No files matched your search
+1
-18
@@ -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."
|
||||
|
||||
Reference in new issue
Block a user