From faee57185015dca770ebdab320dbdcf624e6c565 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 13 Jan 2019 23:48:20 +0100 Subject: [PATCH] dunst: kill daemon on configuration change Since Dunst is DBus activated it is OK to simply kill it since DBus will restart it when necessary. --- modules/services/dunst.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index 0e82d43b..0a5daf38 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -155,7 +155,17 @@ in } (mkIf (cfg.settings != {}) { - xdg.configFile."dunst/dunstrc".text = toDunstIni cfg.settings; + xdg.configFile."dunst/dunstrc" = { + text = toDunstIni cfg.settings; + onChange = '' + pkillVerbose="" + if [[ -v VERBOSE ]]; then + pkillVerbose="-e" + fi + $DRY_RUN_CMD ${pkgs.procps}/bin/pkill -u $USER $pkillVerbose dunst + unset pkillVerbose + ''; + }; }) ] );