39 lines
1.4 KiB
Nix
39 lines
1.4 KiB
Nix
{...}: {
|
|
services.hypridle = {
|
|
enable = true;
|
|
settings = {
|
|
general = {
|
|
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
|
|
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
|
after_sleep_cmd = "hyprctl dispatch dpms on"; # avoid needing to press a key twice to turn on the display.
|
|
};
|
|
|
|
listener = [
|
|
# {
|
|
# timeout = 150;
|
|
# on-timeout = "brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
|
|
# on-resume = "brightnessctl -r"; # restore monitor backlight.
|
|
# }
|
|
# {
|
|
# timeout = 150;
|
|
# on-timeout = "brightnessctl -sd rgb:kbd_backlight set 0"; # turn off keyboard backlight.
|
|
# on-resume = "brightnessctl -rd rgb:kbd_backlight"; # turn on keyboard backlight.
|
|
# }
|
|
# {
|
|
# timeout = 300;
|
|
# on-timeout = "loginctl lock-session"; # lock screen when timeout has passed.
|
|
# }
|
|
# {
|
|
# timeout = 330;
|
|
# on-timeout = "hyprctl dispatch dpms off"; # screen off after 5.5min.
|
|
# on-resume = "hyprctl dispatch dpms on && brightnessctl -r"; # screen on and restore brightness on resume.
|
|
# }
|
|
{
|
|
timeout = 300;
|
|
on-timeout = "systemctl suspend"; # suspend PC after 30min.
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|