From 81ff9e822e6bb6003e55c5bce59a6571c1f9150a Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Thu, 8 Feb 2024 15:00:33 +0100 Subject: [PATCH] Swayidle: fix screen brightness with brillo --- modules/hm/swayidle.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/hm/swayidle.nix b/modules/hm/swayidle.nix index 3b6f1b3..b3961c5 100644 --- a/modules/hm/swayidle.nix +++ b/modules/hm/swayidle.nix @@ -1,4 +1,6 @@ { pkgs, ... }: { + home.packages = builtins.attrValues { inherit (pkgs) brillo; }; + services.swayidle = { enable = true; events = [ @@ -6,7 +8,16 @@ { event = "lock"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; } ]; timeouts = [ - { timeout = 120; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; } + { + timeout = 30; + command = "${pkgs.brillo}/bin/brillo -e -O; ${pkgs.brillo}/bin/brillo -e -S 30"; + resumeCommand = "${pkgs.brillo}/bin/brillo -e -I"; + } + { + timeout = 120; + command = "${pkgs.brillo}/bin/brillo -e -S 0; ${pkgs.way-lockscreen}/bin/way-lockscreen"; + resumeCommand = "${pkgs.brillo}/bin/brillo -e -I"; + } ]; }; }