From b6909c162b15e49ae0f4172bd9fcdad2949cfcfd Mon Sep 17 00:00:00 2001 From: JuliusFreudenberger Date: Sat, 27 Jun 2026 17:11:20 +0200 Subject: [PATCH] Add screen dimming and switching off displays on idle --- home/sway.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home/sway.nix b/home/sway.nix index 655717e..6dc7103 100644 --- a/home/sway.nix +++ b/home/sway.nix @@ -245,6 +245,8 @@ in { }; services.swayidle = let + dimDuration = 15; + dimScreen = "${lib.getExe pkgs.chayang} -d ${toString dimDuration}"; swaylock = "${lib.getExe pkgs.swaylock} -f"; switchOutput = "${pkgs.sway}/bin/swaymsg 'output * power'"; in { @@ -255,8 +257,7 @@ in { after-resume = "${switchOutput} on"; }; timeouts = [ - { timeout = 300; command = "${switchOutput} off"; } - { timeout = 330; command = swaylock; } + { timeout = 300; command = "${dimScreen} && ${switchOutput} off && ${swaylock}"; resumeCommand = "${switchOutput} on"; } ]; };