sleep hack for surface

This commit is contained in:
Henrik Bakken
2025-11-06 15:42:30 +01:00
parent 8c2dcfcfa5
commit a6e27b8903
6 changed files with 36 additions and 9 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ case $SELECTION in
gtklock;;
*"󰤄 Suspend"*)
if confirm_action "Suspend"; then
systemctl suspend
systemctl suspend-then-hibernate
fi;;
*"󰍃 Log out"*)
if confirm_action "Log out"; then
@@ -1,8 +1,8 @@
[Login]
IdleAction=suspend-then-hibernate
IdleAction=hibernate
IdleActionSec=10min
HandlePowerKey=suspend-then-hibernate
HandlePowerKey=hibernate
HandlePowerKeyLongPress=poweroff
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
HandleLidSwitch=hibernate
HandleLidSwitchExternalPower=hibernate
HandleLidSwitchDocked=ignore
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# This file (or a link to it) must be in /lib/systemd/system-sleep/iptsd.sh
logger -t "iptsd-hack" "\$0=$0, \$1=$1, \$2=$2"
if [ $1 == "pre" ]; then
logger -t "iptsd-hack" "stopping iptsd"
iptsd-systemd -- stop
else
logger -t "iptsd-hack" "starting iptsd"
iptsd-systemd -- start
fi
@@ -1,8 +1,8 @@
[Login]
IdleAction=suspend-then-hibernate
IdleAction=hibernate
IdleActionSec=10min
HandlePowerKey=suspend-then-hibernate
HandlePowerKey=hibernate
HandlePowerKeyLongPress=poweroff
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
HandleLidSwitch=hibernate
HandleLidSwitchExternalPower=hibernate
HandleLidSwitchDocked=ignore
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# This file (or a link to it) must be in /lib/systemd/system-sleep/iptsd.sh
logger -t "iptsd-hack" "\$0=$0, \$1=$1, \$2=$2"
if [ $1 == "pre" ]; then
logger -t "iptsd-hack" "stopping iptsd"
iptsd-systemd -- stop
else
logger -t "iptsd-hack" "starting iptsd"
iptsd-systemd -- start
fi
+3
View File
@@ -345,8 +345,11 @@ def install_sway(overwrite: bool, reinstall: bool) -> None:
"etc/systemd/logind.conf.d/suspend.conf",
"etc/systemd/sleep.conf.d/hibernate.conf",
"etc/greetd/sway.cfg",
"lib/systemd/system-sleep/iptsd.sh",
]:
src = CUSTOM_SRC / "ROOT" / sub
if not src.exists():
continue
tgt = ROOT_TGT / sub
run(["sudo", "mkdir", "-p", str(tgt.parent)])
if tgt.exists():