infrastructure/home/desktop/swayidle.nix

35 lines
708 B
Nix
Raw Normal View History

{
pkgs,
2024-06-16 13:49:52 +00:00
lib,
...
}: {
services.swayidle = {
enable = true;
systemdTarget = "hyprland-session.target";
events = [
{
event = "after-resume";
command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
{
event = "before-sleep";
2024-06-16 13:49:52 +00:00
command = "${lib.getExe pkgs.swaylock-effects} -f";
}
];
timeouts = [
{
timeout = 120;
2024-06-16 13:49:52 +00:00
command = "${lib.getExe pkgs.swaylock-effects} -f --grace 3";
}
{
timeout = 150;
command = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off";
}
{
timeout = 300;
command = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
}