infrastructure/home/wayland/swayidle/default.nix

31 lines
699 B
Nix

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