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
8ffa0f2449
commit
bd4fa3a6f4
6 files changed
+36
-35
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#!/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
|
||||
Reference in new issue
Block a user