diff --git a/modules/home/wms/programs/swayidle/default.nix b/modules/home/wms/programs/swayidle/default.nix index d65c2d93..48ae444a 100644 --- a/modules/home/wms/programs/swayidle/default.nix +++ b/modules/home/wms/programs/swayidle/default.nix @@ -1,31 +1,49 @@ { config, lib, pkgs, ... }: +let + lockcommand = "${pkgs.swaylock-effects}/bin/swaylock --daemonize"; + unlockcommand = "pkill -SIGUSR1 swaylock"; + timeoutcommand = "${pkgs.sway}/bin/swaymsg \"output * dpms off\""; + resumecommand = "${pkgs.sway}/bin/swaymsg \"output * dpms on\""; +in { config = lib.mkIf config.home.desktop.enable { services.swayidle = { enable = config.home.desktop.enable; - timeouts = [ - { - timeout = 1800; - command = "notify-send 'Locking in 30 seconds'"; - } - { - timeout = 1830; - command = "swaylock"; - } - { - timeout = 3600; - command = "swaymsg 'output * dpms off'"; - resumeCommand = "swaymsg 'output * dpms on'"; - } - { - timeout = 3605; - command = "systemctl suspend"; - } - ]; events = [ { event = "before-sleep"; - command = "swaylock"; + command = lockcommand; + } + { + event = "lock"; + command = lockcommand; + } + { + event = "unlock"; + command = unlockcommand; + } + { + event = "after-resume"; + command = resumecommand; + } + ]; + timeouts = [ + { + timeout = 1800; # 30m + command = "${pkgs.libnotify}/bin/notify-send \"Locking in 30 seconds\""; + } + { + timeout = 1830; + command = lockcommand; + } + { + timeout = 3600; # 1h + command = timeoutcommand; + resumeCommand = resumecommand; + } + { + timeout = 3605; + command = "${pkgs.systemd}/bin/systemctl suspend"; } ]; }; diff --git a/modules/home/wms/programs/waybar/default.nix b/modules/home/wms/programs/waybar/default.nix index ba2d3f12..af3b851f 100644 --- a/modules/home/wms/programs/waybar/default.nix +++ b/modules/home/wms/programs/waybar/default.nix @@ -217,9 +217,9 @@ position = "top"; layer = "top"; output = [ - "!DP-2" - "!DP-3" - "!HDMI-A-2" + "!${config.displays.tower2}" + "!${config.displays.tower3}" + "!${config.displays.estradiol2}" "*" ]; modules-left = [ @@ -268,9 +268,9 @@ position = "top"; layer = "top"; output = [ - "DP-2" - "DP-3" - "HDMI-A-2" + config.displays.tower2 + config.displays.tower3 + config.displays.estradiol2 ]; modules-left = [ "sway/workspaces"