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

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 {