feat(wip): add swayidle

This commit is contained in:
Michael Mandl 2023-09-26 13:06:56 +02:00
parent 8d33d629c7
commit fd7095bbe7
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7

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 = {