waybar: add onChange configuration reload

This commit is contained in:
Gabriel Fontes 2021-08-19 00:31:11 -03:00
parent 8f1d8c2ef1
commit d5151186ac
No known key found for this signature in database
GPG Key ID: 2E54EA7BFE630916
1 changed files with 12 additions and 2 deletions

View File

@ -366,11 +366,21 @@ in {
# Generate warnings about defined but unreferenced modules
inherit warnings;
xdg.configFile."waybar/config".source = configSource;
xdg.configFile."waybar/config" = {
source = configSource;
onChange = ''
${pkgs.procps}/bin/pkill -u $USER -USR2 waybar || true
'';
};
})
(mkIf (cfg.style != null) {
xdg.configFile."waybar/style.css".text = cfg.style;
xdg.configFile."waybar/style.css" = {
text = cfg.style;
onChange = ''
${pkgs.procps}/bin/pkill -u $USER -USR2 waybar || true
'';
};
})
(mkIf cfg.systemd.enable {