feat: correctly configure hypridle

This commit is contained in:
Youwen Wu 2024-12-13 18:31:03 -08:00
parent 1e2b4421c4
commit 789de86840
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -378,9 +378,26 @@
services.hypridle = {
enable = true;
settings = {
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
general = {
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
};
listener = [
{
timeout = 1500;
on-timeout = "loginctl lock-session";
}
{
timeout = 330; # 5.5min
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired.
}
{
timeout = 1800;
on-timeout = "systemctl suspend";
}
];
};
};
}