Setup hypridle for automatically dimming, locking and sleeping

This commit is contained in:
larstvei 2025-09-29 00:08:08 +02:00
parent 970196d5fb
commit 8dc0ad1d34

View File

@ -3,6 +3,31 @@
programs.kitty.enable = true; programs.kitty.enable = true;
programs.hyprlock.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 = { wayland.windowManager.hyprland = {
enable = true; enable = true;