From e7371a9a7cf2a04481be2f7e13f5eba12523e218 Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sat, 1 Mar 2025 14:44:15 +0100 Subject: [PATCH] fixup! Hyprland: inhibit idle if fullscreen --- modules/hm/hyprland.nix | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/modules/hm/hyprland.nix b/modules/hm/hyprland.nix index 086a99f..f95258b 100644 --- a/modules/hm/hyprland.nix +++ b/modules/hm/hyprland.nix @@ -13,7 +13,7 @@ in # ./dunst.nix # ./wlsunset.nix ./hyprlock.nix - ./swayidle.nix + # ./swayidle.nix ./swaynotificationcenter.nix ./wl_update_background.nix ./hyprland-bluetooth-keyboard.nix @@ -47,6 +47,34 @@ in network-manager-applet.enable = true; blueman-applet.enable = true; + hypridle = { + enable = true; + settings = { + general = { + # ignore_dbus_inhibit = false; + lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances. + before_sleep_cmd = "loginctl lock-session"; # lock before suspend. + after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display + }; + listener = [ + { + timeout = 60; + on-timeout = "${pkgs.brillo}/bin/brillo -e -O; ${pkgs.brillo}/bin/brillo -e -S 10 -u 1000000"; + on-resume = "${pkgs.brillo}/bin/brillo -e -I"; + } + { + timeout = 120; + on-timeout = "${pkgs.brillo}/bin/brillo -e -S 0; loginctl lock-session "; + on-resume = "${pkgs.brillo}/bin/brillo -e -S 100"; + } + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + } + ]; + }; + }; hyprpaper = { enable = true; settings = {