diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index 9d49225..e685e99 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -332,17 +332,23 @@ in } ]; - timeouts = [ - { - timeout = 900; - command = swaylockcmd; - } - { - timeout = 1200; - command = "${pkgs.sway}/bin/swaymsg 'output * power off'"; - resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * power on'"; - } - ]; + timeouts = + let + resumeMessages = builtins.concatStringsSep ", " ( + builtins.map (name: "output ${name} power on") (builtins.attrNames cfg.output) + ); + in + [ + { + timeout = 900; + command = swaylockcmd; + } + { + timeout = 1200; + command = "${pkgs.sway}/bin/swaymsg 'output * power off'"; + resumeCommand = "${pkgs.sway}/bin/swaymsg '${resumeMessages}'"; + } + ]; }; };