]> git.rmz.io Git - dotfiles.git/blobdiff - xinit/xprofile.d/10-screensaver.sh
xidlehook: replace xautolock with xidlehook
[dotfiles.git] / xinit / xprofile.d / 10-screensaver.sh
index 0b3624918d35e7f491d2acf26fe277aa3f32a021..b17f30e601ad2fc3aaa98225a842e45c546bd515 100755 (executable)
@@ -1,6 +1,29 @@
 #!/usr/bin/env bash
 
-xset s 600
-xset dpms 300 900 1800  # 5m 15m 30m
-# settings can be found in Xresources
-xautolock -detectsleep &
+export XIDLEHOOK_SOCKET=$XDG_RUNTIME_DIR/xidlehook.socket
+alias xidlehook-client='xidlehook-client --socket $XIDLEHOOK_SOCKET'
+
+if [[ $(hostname) == "hactar" ]]; then
+    xidlehook \
+        --socket=$XIDLEHOOK_SOCKET \
+        --not-when-fullscreen \
+        --timer 300  'xset dpms force off' '' \
+        --timer 300  'i3lock -c 000000'    '' \
+        --timer 3600 'systemctl suspend'   '' \
+        &
+elif [[ $(hostname) == "chronos" ]]; then
+    xidlehook \
+        --socket=$XIDLEHOOK_SOCKET \
+        --not-when-fullscreen \
+        --timer 300  'xset dpms force off' '' \
+        --timer 300  'i3lock -c 000000'    '' \
+        --timer 1800 'systemctl suspend'   '' \
+        &
+elif [[ $(hostname) == "skull-canyon" ]]; then
+    xidlehook \
+        --socket=$XIDLEHOOK_SOCKET \
+        --not-when-fullscreen \
+        --timer 300  'xset dpms force off' '' \
+        --timer 300  'i3lock -c 000000'    '' \
+        &
+fi