mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-14 23:22:31 +02:00
refactor: call parent update
This commit is contained in:
@ -10,11 +10,6 @@ waybar::modules::Cpu::Cpu(const std::string& id, const Json::Value& config)
|
||||
}
|
||||
|
||||
auto waybar::modules::Cpu::update() -> void {
|
||||
// Run user-provided update handler if configured
|
||||
if (config_["on-update"].isString()) {
|
||||
AModule::update();
|
||||
}
|
||||
|
||||
// TODO: as creating dynamic fmt::arg arrays is buggy we have to calc both
|
||||
auto cpu_load = getCpuLoad();
|
||||
auto [cpu_usage, tooltip] = getCpuUsage();
|
||||
@ -23,6 +18,8 @@ auto waybar::modules::Cpu::update() -> void {
|
||||
}
|
||||
label_.set_markup(fmt::format(format_, fmt::arg("load", cpu_load), fmt::arg("usage", cpu_usage)));
|
||||
getState(cpu_usage);
|
||||
// Call parent update
|
||||
ALabel::update();
|
||||
}
|
||||
|
||||
uint16_t waybar::modules::Cpu::getCpuLoad() {
|
||||
|
Reference in New Issue
Block a user