From 6469af670d055c8f4a72a6e03a19d34f931ef177 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Mon, 20 Sep 2021 21:10:56 +0200 Subject: use xidlehook instead of xautolock --- home/config/i3/startup.nix | 2 +- home/config/xsession.nix | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/home/config/i3/startup.nix b/home/config/i3/startup.nix index a6576da..3c7cdf3 100644 --- a/home/config/i3/startup.nix +++ b/home/config/i3/startup.nix @@ -20,7 +20,7 @@ in { [ (autostart { command = - "systemctl --user start xautolock-session.service xss-lock.service"; + "systemctl --user xidlehook.service"; }) ] else diff --git a/home/config/xsession.nix b/home/config/xsession.nix index bc01f56..4855aed 100644 --- a/home/config/xsession.nix +++ b/home/config/xsession.nix @@ -30,9 +30,20 @@ in { }; # Session managment - services.screen-locker = { + services.xidlehook = { enable = backgroundImage != null; - lockCmd = "${lockscreen}/bin/lockscreen.sh"; - inactiveInterval = 5; + not-when-fullscreen = true; + not-when-audio = true; + timers = [ + { + delay = 120; + command = "${pkgs.brightnessctl}/bin/brightnessctl set 10%-"; + canceller = "${pkgs.brightnessctl}/bin/brightnessctl set +10%"; + } + { + delay = 180; + command = "${lockscreen}/bin/lockscreen.sh"; + } + ]; }; } -- cgit v1.2.3