diff --git a/modules/default.nix b/modules/default.nix index 5bbb8ed..295a8db 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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 diff --git a/modules/user/hypridle.nix b/modules/user/hypridle.nix new file mode 100644 index 0000000..1d28371 --- /dev/null +++ b/modules/user/hypridle.nix @@ -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"; + } + ]; + }; + }; +} diff --git a/users/rin/wayland.nix b/users/rin/wayland.nix index 9ef02af..df32eea 100644 --- a/users/rin/wayland.nix +++ b/users/rin/wayland.nix @@ -31,6 +31,7 @@ theming xdg + hypridle hyprlock kitty mpv