From e2456423f4db24ecb816ea03264fa9cf9d6f98bb Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Fri, 8 May 2020 15:03:17 +0100 Subject: [PATCH] xidlehook: replace xautolock with xidlehook --- xinit/Xresources.d/chronos | 6 ------ xinit/Xresources.d/hactar | 6 ------ xinit/Xresources.d/skull-canyon | 5 ----- xinit/xprofile.d/10-screensaver.sh | 31 ++++++++++++++++++++++++++---- 4 files changed, 27 insertions(+), 21 deletions(-) delete mode 100644 xinit/Xresources.d/chronos delete mode 100644 xinit/Xresources.d/hactar diff --git a/xinit/Xresources.d/chronos b/xinit/Xresources.d/chronos deleted file mode 100644 index 6728bf9..0000000 --- a/xinit/Xresources.d/chronos +++ /dev/null @@ -1,6 +0,0 @@ -Xautolock.notify: 600 -Xautolock.notifier: xset dpms force off -Xautolock.time: 20 -Xautolock.locker: i3lock -nc 000000 -Xautolock.killtime: 70 -Xautolock.killer: systemctl suspend diff --git a/xinit/Xresources.d/hactar b/xinit/Xresources.d/hactar deleted file mode 100644 index 6728bf9..0000000 --- a/xinit/Xresources.d/hactar +++ /dev/null @@ -1,6 +0,0 @@ -Xautolock.notify: 600 -Xautolock.notifier: xset dpms force off -Xautolock.time: 20 -Xautolock.locker: i3lock -nc 000000 -Xautolock.killtime: 70 -Xautolock.killer: systemctl suspend diff --git a/xinit/Xresources.d/skull-canyon b/xinit/Xresources.d/skull-canyon index e5d1a1f..7931cad 100644 --- a/xinit/Xresources.d/skull-canyon +++ b/xinit/Xresources.d/skull-canyon @@ -1,6 +1 @@ Xft.dpi: 168 - -Xautolock.notify: 600 -Xautolock.notifier: xset dmps force off -Xautolock.time: 20 -Xautolock.locker: i3lock -nc 000000 diff --git a/xinit/xprofile.d/10-screensaver.sh b/xinit/xprofile.d/10-screensaver.sh index 0b36249..b17f30e 100755 --- a/xinit/xprofile.d/10-screensaver.sh +++ b/xinit/xprofile.d/10-screensaver.sh @@ -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 -- 2.48.1