From 1b9b59866265fd1e07d52ef365653ab67743a27a Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 19 Apr 2021 16:17:57 +0000 Subject: [PATCH] home: wm: screen-lock: add corner delay setting --- home/wm/default.nix | 17 +++++++++++++---- home/wm/screen-lock.nix | 6 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/home/wm/default.nix b/home/wm/default.nix index b4cece9..f4f0ad2 100644 --- a/home/wm/default.nix +++ b/home/wm/default.nix @@ -47,10 +47,19 @@ in description = "Locker command to run"; }; - cornerLock = my.mkDisableOption '' - Move mouse to upper-left corner to lock instantly, lower-right corner to - disable auto-lock. - ''; + cornerLock = { + enable = my.mkDisableOption '' + Move mouse to upper-left corner to lock instantly, lower-right corner to + disable auto-lock. + ''; + + delay = mkOption { + type = types.int; + default = 5; + example = 15; + description = "How many seconds before locking this way"; + }; + }; notify = my.mkDisableOption "Notify when about to lock the screen"; diff --git a/home/wm/screen-lock.nix b/home/wm/screen-lock.nix index e6eee22..1632be7 100644 --- a/home/wm/screen-lock.nix +++ b/home/wm/screen-lock.nix @@ -11,12 +11,12 @@ in lockCmd = cfg.command; - xautolockExtraOptions = lib.optionals cfg.cornerLock [ + xautolockExtraOptions = lib.optionals cfg.cornerLock.enable [ # Mouse corners: instant lock on upper-left, never lock on lower-right "-cornerdelay" - "5" + "${toString cfg.cornerLock.delay}" "-cornerredelay" - "5" + "${toString cfg.cornerLock.delay}" "-corners" "+00-" ] ++ lib.optionals cfg.notify [