user/hypridle: init

This commit is contained in:
LavaDesu 2025-03-17 15:52:18 +11:00
parent 0fed2f3599
commit 38bcba4756
Signed by: cilly
GPG key ID: 6500251E087653C9
3 changed files with 44 additions and 0 deletions

View file

@ -57,6 +57,7 @@ in {
./user/eww-wayland.nix
./user/git.nix
./user/gpg.nix
./user/hypridle.nix
./user/hyprlock.nix
./user/kitty.nix
./user/mpv.nix

42
modules/user/hypridle.nix Normal file
View file

@ -0,0 +1,42 @@
{ ... }:
let
kblight = "light -s sysfs/leds/asus::kbd_backlight";
in
{
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 120;
on-timeout = "${kblight} -O && ${kblight} -S 0";
on-resume = "${kblight} -I";
}
{
timeout = 150;
on-timeout = "light -O && light -T 0.5";
on-resume = "light -I";
}
{
timeout = 180;
on-timeout = "light -I && loginctl lock-session";
}
{
timeout = 195;
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
{
timeout = 600;
on-timeout = "systemctl suspend";
}
];
};
};
}

View file

@ -31,6 +31,7 @@
theming
xdg
hypridle
hyprlock
kitty
mpv