feat(wip): add swayidle

main
mandlm 2023-09-26 13:06:56 +02:00
parent 8d33d629c7
commit fd7095bbe7
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
1 changed files with 14 additions and 1 deletions

View File

@ -2,6 +2,8 @@
let
font.name = "DejaVu Sans Mono";
font.size = 12.0;
lock_command = "${pkgs.swaylock-fancy}/bin/swaylock-fancy --daemonize --show-failed-attempts --ignore-empty-password";
swaymsg = "${pkgs.sway}/bin/swaymsg";
in
{
imports = [
@ -39,6 +41,17 @@ in
};
};
services.swayidle = {
enable = true;
events = [
{ event = "before-sleep"; command = lock_command; }
];
timeouts = [
{ timeout = 300; command = "${swaymsg} output '*' power off"; resumeCommand = "${swaymsg} output '*' power on"; }
{ timeout = 900; command = lock_command; }
];
};
wayland.windowManager.sway = {
enable = true;
@ -90,7 +103,7 @@ in
in
lib.mkOptionDefault {
"${modifier}+Shift+o" = "exec xdg-open \"zoommtg://zoom.us/join?action=join&confno=4861587170&pwd=ZVk3aHphcWppY21ONjZOMVh6STN6dz09\"";
"${modifier}+l" = "exec swaylock-fancy";
"${modifier}+l" = "exec ${lock_command}";
};
assigns = {