diff options
Diffstat (limited to 'home-manager/modules/services/screen-locker.nix')
-rw-r--r-- | home-manager/modules/services/screen-locker.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/home-manager/modules/services/screen-locker.nix b/home-manager/modules/services/screen-locker.nix index 30591a7d1a5..554d64f9abe 100644 --- a/home-manager/modules/services/screen-locker.nix +++ b/home-manager/modules/services/screen-locker.nix @@ -17,6 +17,14 @@ in { example = "\${pkgs.i3lock}/bin/i3lock -n -c 000000"; }; + enableDetectSleep = mkOption { + type = types.bool; + default = true; + description = '' + Whether to reset timers when awaking from sleep. + ''; + }; + inactiveInterval = mkOption { type = types.int; default = 10; @@ -42,7 +50,6 @@ in { Extra command-line arguments to pass to <command>xss-lock</command>. ''; }; - }; config = mkIf cfg.enable { @@ -58,10 +65,10 @@ in { Service = { ExecStart = concatStringsSep " " ([ "${pkgs.xautolock}/bin/xautolock" - "-detectsleep" "-time ${toString cfg.inactiveInterval}" "-locker '${pkgs.systemd}/bin/loginctl lock-session $XDG_SESSION_ID'" - ] ++ cfg.xautolockExtraOptions); + ] ++ optional cfg.enableDetectSleep "-detectsleep" + ++ cfg.xautolockExtraOptions); }; }; |