Commit ef24df8
Changed files (2)
.config
.config/hypr/hypridle.conf
@@ -16,5 +16,5 @@ listener {
listener {
timeout = 1200
- on-timeout = systemctl suspend
+ on-timeout = /home/robin/.config/hypr/idle-check.sh # abort if ssh active
}
.config/hypr/idle-check.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# skip suspend while an incoming ssh session is established
+# (hypridle refires this listener every 1200s while idle, so it retries
+# once the ssh connection drops)
+ss -H -tn state established '( sport = :22 )' | grep -q . && exit 0
+systemctl suspend