62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
{ 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";
|
|
};
|
|
# TODO: add monitor shut off timout
|
|
# battery timers
|
|
listener = [
|
|
{
|
|
timeout = 30;
|
|
on-timeout = "systemd-ac-power || light -S 0";
|
|
on-resume = "systemd-ac-power || light -I";
|
|
}
|
|
|
|
{
|
|
timeout = "30";
|
|
on-timeout = "systemd-ac-power || light -s razer/0003:1532:02B6.0004/backlight -S 0";
|
|
on-resume = "systemd-ac-power || light -s razer/0003:1532:02B6.0004/backlight -S 40";
|
|
}
|
|
|
|
{
|
|
timeout = "120";
|
|
on-timeout = "systemd-ac-power || systemd-ac-power && loginctl lock-session";
|
|
}
|
|
|
|
{
|
|
timeout = "600";
|
|
on-timeout = "systemd-ac-power || systemctl suspend";
|
|
}
|
|
|
|
# ac power timers
|
|
{
|
|
timeout = "60";
|
|
on-timeout = "systemd-ac-power && light -S 0";
|
|
on-resume = "systemd-ac-power && light -I";
|
|
}
|
|
|
|
{
|
|
timeout = "60";
|
|
on-timeout = "systemd-ac-power && light -s razer/0003:1532:02B6.0004/backlight -S 0";
|
|
on-resume = "systemd-ac-power && light -s razer/0003:1532:02B6.0004/backlight -S 40";
|
|
}
|
|
|
|
{
|
|
timeout = "300";
|
|
on-timeout = "systemd-ac-power && loginctl lock-session";
|
|
}
|
|
|
|
{
|
|
timeout = "1800";
|
|
on-timeout = "systemd-ac-power && systemctl suspend";
|
|
}
|
|
];
|
|
|
|
};
|
|
};
|
|
}
|