home: wm: screen-lock: add xautolock options
This commit is contained in:
parent
9f6c614c9f
commit
cdc29efafc
|
@ -47,6 +47,13 @@ in
|
||||||
description = "Locker command to run";
|
description = "Locker command to run";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cornerLock = my.mkDisableOption ''
|
||||||
|
Move mouse to upper-left corner to lock instantly, lower-right corner to
|
||||||
|
disable auto-lock.
|
||||||
|
'';
|
||||||
|
|
||||||
|
notify = my.mkDisableOption "Notify when about to lock the screen";
|
||||||
|
|
||||||
timeout = mkOption {
|
timeout = mkOption {
|
||||||
type = types.ints.between 1 60;
|
type = types.ints.between 1 60;
|
||||||
default = 5;
|
default = 5;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.home.wm.screen-lock;
|
cfg = config.my.home.wm.screen-lock;
|
||||||
in
|
in
|
||||||
|
@ -10,6 +10,21 @@ in
|
||||||
inactiveInterval = cfg.timeout;
|
inactiveInterval = cfg.timeout;
|
||||||
|
|
||||||
lockCmd = cfg.command;
|
lockCmd = cfg.command;
|
||||||
|
|
||||||
|
xautolockExtraOptions = lib.optionals cfg.cornerLock [
|
||||||
|
# Mouse corners: instant lock on upper-left, never lock on lower-right
|
||||||
|
"-cornerdelay"
|
||||||
|
"5"
|
||||||
|
"-cornerredelay"
|
||||||
|
"5"
|
||||||
|
"-corners"
|
||||||
|
"+00-"
|
||||||
|
] ++ lib.optionals cfg.notify [
|
||||||
|
"-notify"
|
||||||
|
"5"
|
||||||
|
"-notifier"
|
||||||
|
''"${pkgs.libnotify}/bin/notify-send -u critical -t 5000 -- 'Locking in 5 seconds'"''
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue