This commit is contained in:
Alex
2018-08-20 14:50:45 +02:00
committed by GitHub
parent b7e3d10fb7
commit 49232eed8d
30 changed files with 261 additions and 235 deletions

View File

@ -1,13 +1,12 @@
#include "modules/cpu.hpp"
waybar::modules::Cpu::Cpu(Json::Value config)
: ALabel(std::move(config))
waybar::modules::Cpu::Cpu(const Json::Value& config)
: ALabel(config)
{
label_.set_name("cpu");
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 10;
thread_.sig_update.connect(sigc::mem_fun(*this, &Cpu::update));
thread_ = [this, interval] {
thread_.emit();
dp.emit();
thread_.sleep_for(chrono::seconds(interval));
};
}