summaryrefslogtreecommitdiff
path: root/home/desktops/hyprland/idle.nix
diff options
context:
space:
mode:
Diffstat (limited to 'home/desktops/hyprland/idle.nix')
-rw-r--r--home/desktops/hyprland/idle.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/home/desktops/hyprland/idle.nix b/home/desktops/hyprland/idle.nix
new file mode 100644
index 0000000..0a2b951
--- /dev/null
+++ b/home/desktops/hyprland/idle.nix
@@ -0,0 +1,35 @@
+{config, ...}: {
+ services.hypridle = {
+ enable = config.desktops.hyprland.enable;
+ systemdTarget = "hyprland-session.target";
+
+ settings = {
+ general = {
+ lock_cmd = "pidof ${config.default.lockScreen} || ${config.default.lockScreen}";
+ before_sleep_cmd = "loginctl lock-session";
+ after_sleep_cmd = "hyprctl dispatch dpms on";
+ ignore_dbus_inhibit = false;
+ };
+
+ listener = [
+ # dim screen
+ {
+ timeout = 150;
+ on-timeout = "brightnessctl -s set 10";
+ on-resume = "brightnessctl -r";
+ }
+ # lock
+ {
+ timeout = 300;
+ on-timeout = "loginctl lock-session";
+ }
+ # turn off screen
+ {
+ timeout = 350;
+ on-timeout = "hyprctl dispatch dpms off";
+ on-resume = "hyprctl dispatch dpms on";
+ }
+ ];
+ };
+ };
+}