entirely vibed refactor
This commit is contained in:
parent
cea12431ff
commit
c343c52ab7
78 changed files with 884 additions and 1099 deletions
47
home/modules/services/swayidle.nix
Normal file
47
home/modules/services/swayidle.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
commands = import ../../../lib/commands.nix { inherit pkgs; };
|
||||
inherit (commands) notify lock display;
|
||||
in
|
||||
{
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 120;
|
||||
command = "${notify} 'Locking in 5 seconds' -t 5000";
|
||||
}
|
||||
{
|
||||
timeout = 125;
|
||||
command = lock;
|
||||
}
|
||||
{
|
||||
timeout = 125;
|
||||
command = display "off";
|
||||
resumeCommand = display "on";
|
||||
}
|
||||
{
|
||||
timeout = 600;
|
||||
command = "${pkgs.systemd}/bin/systemctl suspend";
|
||||
}
|
||||
];
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "display off; systemctl --user stop libinput-gestures; ${lock}";
|
||||
}
|
||||
{
|
||||
event = "after-resume";
|
||||
command = "display on; systemctl --user start libinput-gestures";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = (display "off") + "; " + lock;
|
||||
}
|
||||
{
|
||||
event = "unlock";
|
||||
command = display "on";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue