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

@ -35,6 +35,11 @@ waybar::modules::MPD::MPD(const std::string& id, const Json::Value& config)
}
auto waybar::modules::MPD::update() -> void {
// Run user-provided update handler if configured
if (config_["on-update"].isString()) {
AModule::update();
}
std::lock_guard guard(connection_lock_);
tryConnect();