From 2d171ced9365bac5a592c2a809d93946933a68d8 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 26 Sep 2022 17:13:18 +0100 Subject: [PATCH] xprofile: use xss-lock and loginctl lock-session to trigger i3lock xss-lock makes sure that i3lock is triggered when the session is locked via systemd by other means than xidlehook, i.e. LidClose events. Since there is now a handler for session locking in systemd, might as well use that on the timer as well via lock-session. --- xprofile.d/10-screensaver.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xprofile.d/10-screensaver.sh b/xprofile.d/10-screensaver.sh index 8a2368d..4e9a048 100755 --- a/xprofile.d/10-screensaver.sh +++ b/xprofile.d/10-screensaver.sh @@ -4,17 +4,17 @@ 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' '' \ + --timer 300 'xset dpms force off' '' \ + --timer 300 'loginctl lock-session' '' \ + --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' '' \ + --timer 300 'xset dpms force off' '' \ + --timer 300 'loginctl lock-session' '' \ + --timer 1800 'systemctl suspend' '' \ & elif [[ $(hostname) == "skull-canyon" ]]; then xidlehook \ @@ -24,3 +24,5 @@ elif [[ $(hostname) == "skull-canyon" ]]; then --timer 300 'i3lock -c 000000' '' \ & fi + +xss-lock -- i3lock --nofork --color=000000 & -- 2.48.1