nixos-config/modules/home/hypridle.nix

57 lines
1.4 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";
ignore_dbus_inhibit = false;
ignore_systemd_inhibit = false;
};
# TODO add screen dimming and test configurations with different monitors
listener = [
# battery timers
{
timeout = "60";
on-timeout = "systemd-ac-power || dim-all-monitors";
on-resume = "brillo -e -u 150000 -I";
}
{
timeout = "120";
on-timeout = "systemd-ac-power || lock-power-off-monitors";
}
{
timeout = "300";
on-timeout = "systemd-ac-power || lock-suspend";
}
# ac power timers
{
timeout = "90";
on-timeout = "systemd-ac-power && dim-all-monitors";
on-resume = "brillo -e -u 150000 -I";
}
{
timeout = "180";
on-timeout = "systemd-ac-power && loginctl lock-session";
}
{
timeout = "200";
on-timeout = "systemd-ac-power && lock-power-off-monitors";
}
{
timeout = "600";
on-timeout = "systemd-ac-power && lock-suspend";
}
];
};
};
}