nixos-config/modules/home/hypridle.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

2025-02-05 00:50:55 -05:00
{ inputs, ... }:
{
services.hypridle = {
enable = true;
package = inputs.hypridle.packages.x86_64-linux.default;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
};
2025-02-06 13:56:58 -05:00
2025-02-05 00:50:55 -05:00
# battery timers
listener = [
{
timeout = "30";
2025-02-06 18:58:39 -05:00
on-timeout = "systemd-ac-power || light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0";
on-resume = "systemd-ac-power || light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40";
2025-02-05 00:50:55 -05:00
}
{
timeout = "120";
2025-02-06 13:56:58 -05:00
on-timeout = "systemd-ac-power || loginctl lock-session && niri msg action power-off-monitors";
2025-02-05 00:50:55 -05:00
}
{
2025-02-06 13:56:58 -05:00
timeout = "300";
on-timeout = "systemd-ac-power || loginctl lock-session && systemctl suspend";
2025-02-05 00:50:55 -05:00
}
# ac power timers
{
timeout = "60";
2025-02-06 18:58:39 -05:00
on-timeout = "systemd-ac-power && light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0";
on-resume = "systemd-ac-power && light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40";
2025-02-05 00:50:55 -05:00
}
2025-02-06 13:56:58 -05:00
{ timeout = "180";
on-timeout = "systemd-ac-power && loginctl lock-session"; }
2025-02-05 00:50:55 -05:00
2025-02-06 13:56:58 -05:00
{ timeout = "300";
on-timeout = "systemd-ac-power && loginctl lock-session && niri msg action power-off-monitors"; }
2025-02-05 00:50:55 -05:00
{
2025-02-06 13:56:58 -05:00
timeout = "900";
on-timeout = "systemd-ac-power && loginctl lock-session && systemctl suspend";
2025-02-05 00:50:55 -05:00
}
];
};
};
}