mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-18 05:02:10 -08:00
feat: correctly configure hypridle
This commit is contained in:
parent
1e2b4421c4
commit
789de86840
1 changed files with 20 additions and 3 deletions
|
@ -378,9 +378,26 @@
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
|
general = {
|
||||||
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
|
lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
|
||||||
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue