From 02a2b0e9eec99dc9c8ebed90d6bd64f02187623b Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 20 Apr 2024 13:00:45 -0400 Subject: [PATCH] sway: added swayidle suspend and brightness settings --- homeManagerModules/desktop/sway/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 6b098f57..bbc2fe34 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -146,7 +146,18 @@ {command = "${pkgs.swayosd}/bin/swayosd-server";} {command = "${pkgs.networkmanagerapplet}/bin/nm-applet";} {command = "${pkgs.trayscale}/bin/trayscale --hide-window";} - {command = "${pkgs.swayidle}/bin/swayidle -w timeout 300 '${pkgs.swaylock}/bin/swaylock' before-sleep '${pkgs.swaylock}/bin/swaylock'";} + { + command = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' \ + resume '${pkgs.brightnessctl}/bin/brightnessctl -r' \ + timeout 300 '${pkgs.swaylock}/bin/swaylock -f -c 000000' \ + timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' \ + resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' \ + timeout 900 '${pkgs.systemd}/bin/systemctl suspend' \ + before-sleep '${pkgs.swaylock}/bin/swaylock -f -c 000000' + ''; + } ]; output = { "BOE 0x095F Unknown" = {