mirror of
https://github.com/nix-community/home-manager
synced 2024-12-26 03:39:47 +01:00
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.
This commit is contained in:
parent
0809cb8678
commit
382faa84fe
1 changed files with 2 additions and 5 deletions
|
@ -246,11 +246,8 @@ in {
|
||||||
|
|
||||||
xdg.configFile = mapAttrs' (cfgFileSuffix: cfgBar:
|
xdg.configFile = mapAttrs' (cfgFileSuffix: cfgBar:
|
||||||
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({
|
||||||
onChange = mkIf config.xsession.windowManager.i3.enable ''
|
onChange = ''
|
||||||
i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*"
|
${pkgs.procps}/bin/pkill -u $USER -USR2 i3status-rs || true
|
||||||
if [[ -S $i3Socket ]]; then
|
|
||||||
${config.xsession.windowManager.i3.package}/bin/i3-msg -s $i3Socket restart >/dev/null
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({
|
||||||
|
|
Loading…
Reference in a new issue