mirror of
https://github.com/larstvei/nix-config.git
synced 2025-10-13 14:30:12 +00:00
Setup hypridle for automatically dimming, locking and sleeping
This commit is contained in:
parent
970196d5fb
commit
8dc0ad1d34
@ -3,6 +3,31 @@
|
||||
programs.kitty.enable = true;
|
||||
programs.hyprlock.enable = true;
|
||||
|
||||
services.hypridle = {
|
||||
enable = true;
|
||||
settings = {
|
||||
general = {
|
||||
lock_cmd = "hyprlock";
|
||||
before_sleep_cmd = "loginctl lock-session";
|
||||
};
|
||||
listener = [
|
||||
{
|
||||
timeout = 150; # 2.5 min
|
||||
on-timeout = "brightnessctl --save && brightnessctl set 1";
|
||||
on-resume = "brightnessctl --restore";
|
||||
}
|
||||
{
|
||||
timeout = 300; # 5 min
|
||||
on-resume = "loginctl lock-session";
|
||||
}
|
||||
{
|
||||
timeout = 900; # 15 min
|
||||
on-timeout = "systemctl suspend-then-hibernate";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user