1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

polybar: let systemd reload trigger restart

This commit is contained in:
Robert Helgesson 2018-07-26 17:59:06 +02:00
parent cf80199bfc
commit dda65c0877
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -119,6 +119,7 @@ in
Description = "Polybar status bar";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
X-Restart-Triggers = [ config.xdg.configFile."polybar/config".source ];
};
Service = {
@ -131,21 +132,6 @@ in
WantedBy = [ "graphical-session.target" ];
};
};
home.activation.checkPolybar = dag.entryBefore [ "linkGeneration" ] ''
if ! cmp --quiet \
"${configFile}" \
"$HOME/.config/polybar/config"; then
polybarChanged=1
fi
'';
home.activation.applyPolybar = dag.entryAfter [ "reloadSystemD" ] ''
if [[ -v polybarChanged && -v DISPLAY ]]; then
echo "Restarting polybar"
${config.systemd.user.systemctlPath} --user restart polybar.service
fi
'';
};
}