feat(modules): call user on-update if configured

This commit is contained in:
Jordi Pakey-Rodriguez
2019-07-05 14:46:38 -07:00
parent de0a3cb020
commit 0f0765e517
12 changed files with 56 additions and 1 deletions

View File

@ -93,6 +93,11 @@ bool waybar::modules::Custom::handleToggle(GdkEventButton* const& e) {
}
auto waybar::modules::Custom::update() -> void {
// Run user-provided update handler if configured
if (config_["on-update"].isString()) {
AModule::update();
}
// Hide label if output is empty
if (config_["exec"].isString() && (output_.out.empty() || output_.exit_code != 0)) {
event_box_.hide();