reNixos/hand7s/services/hypridle.nix
s0me1newithhand7s 2939b08891 big staging update
Signed-off-by: s0me1newithhand7s <git+me@hand7s.org>
2025-12-29 16:42:07 +03:00

41 lines
884 B
Nix

{
config,
pkgs,
lib,
...
}: {
services = {
hypridle = {
enable =
lib.mkIf (
config.home.gui.sessionType == "Hyprland"
)
true;
settings = {
general = {
before_sleep_cmd = "${lib.getExe' pkgs.hyprland "hyprctl"} dispatch dpms off";
after_sleep_cmd = "${lib.getExe' pkgs.hyprland "hyprctl"} dispatch dpms on";
};
listener = [
{
timeout = 300;
on-timeout = "${lib.getExe pkgs.brightnessctl} -s set 10";
on-resume = "${lib.getExe pkgs.brightnessctl} -r";
}
{
timeout = 600;
on-timeout = "${lib.getExe pkgs.hyprlock}";
}
{
timeout = 900;
on-timeout = "${lib.getExe' pkgs.systemd "systemctl"} suspend";
}
];
};
};
};
}