From 4803bf558bdf20cb067aceb8830b7ad70113f4e3 Mon Sep 17 00:00:00 2001 From: leoTlr Date: Fri, 20 Sep 2024 11:13:54 +0200 Subject: [PATCH] swayidle: make -w optional The option -w causes swayidle to wait on timeouts/events to finish. This can cause problems with certain timout/event commands (see https://github.com/swaywm/swaylock/issues/86#issuecomment-662702180) --- docs/release-notes/rl-2411.md | 11 ++++++++++- modules/misc/news.nix | 14 ++++++++++++++ modules/services/swayidle.nix | 5 ++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/rl-2411.md b/docs/release-notes/rl-2411.md index 85eae034f..6f7a6b7b0 100644 --- a/docs/release-notes/rl-2411.md +++ b/docs/release-notes/rl-2411.md @@ -7,7 +7,16 @@ is therefore not final. This release has the following notable changes: -- No changes. +- The swayidle module behavior has changed. Specifically, swayidle was + previously always called with a `-w` flag. This flag is now moved to + the default + [services.swayidle.extraArgs](#opt-services.swayidle.extraArgs) + value to make it optional. + + Your configuration may break if you already set this option and also + rely on the flag being automatically added. To resolve this, please + add `-w` to your assignment of + [services.swayidle.extraArgs](#opt-services.swayidle.extraArgs). ## State Version Changes {#sec-release-24.11-state-version-changes} diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 410238792..f8786de2f 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1734,6 +1734,20 @@ in { list of themes. ''; } + + { + time = "2024-09-20T07:48:08+00:00"; + condition = hostPlatform.isLinux && config.services.swayidle.enable; + message = '' + The swayidle module behavior has changed. Specifically, swayidle was + previously always called with a `-w` flag. This flag is now moved to + the default `services.swayidle.extraArgs` value to make it optional. + + Your configuration may break if you already set this option and also + rely on the flag being automatically added. To resolve this, please + add `-w` to your assignment of `services.swayidle.extraArgs`. + ''; + } ]; }; } diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index 80317e42a..a2f7d13cb 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -94,7 +94,7 @@ in { extraArgs = mkOption { type = with types; listOf str; - default = [ ]; + default = [ "-w" ]; description = "Extra arguments to pass to swayidle."; }; @@ -127,8 +127,7 @@ in { Restart = "always"; # swayidle executes commands using "sh -c", so the PATH needs to contain a shell. Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ]; - ExecStart = - "${cfg.package}/bin/swayidle -w ${concatStringsSep " " args}"; + ExecStart = "${cfg.package}/bin/swayidle ${concatStringsSep " " args}"; }; Install = { WantedBy = [ cfg.systemdTarget ]; };