From e63a6b34792884bfe4056d1ef561b5611589b8ad Mon Sep 17 00:00:00 2001 From: Florian Peter <4farlion@gmail.com> Date: Mon, 18 Sep 2023 14:25:42 +0100 Subject: [PATCH] programs.i3status-rust: reload on config change (#4466) Adds automatic reloading of i3status-rust on config change. This is done via sending SIGUSR2, which is now supported since [v0.20.0](https://github.com/greshake/i3status-rust/blob/master/NEWS.md#new-blocks-and-features-21) The previous method of attempting to restart i3 in its entirety didn't work at least on my system, and is now overkill anyways. --- modules/programs/i3status-rust.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/programs/i3status-rust.nix b/modules/programs/i3status-rust.nix index c5c020cb4..d9894f62e 100644 --- a/modules/programs/i3status-rust.nix +++ b/modules/programs/i3status-rust.nix @@ -246,11 +246,8 @@ in { xdg.configFile = mapAttrs' (cfgFileSuffix: cfgBar: nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({ - onChange = mkIf config.xsession.windowManager.i3.enable '' - i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*" - if [[ -S $i3Socket ]]; then - ${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart >/dev/null - fi + onChange = '' + ${pkgs.procps}/bin/pkill -u $USER -USR2 i3status-rs || true ''; source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({