Merge pull request #53 from dangerousdan/fix-clock-interval

fix custom intervals causing cpu to go mental
This commit is contained in:
Alex 2018-10-23 03:02:23 +02:00 committed by GitHub
commit da0674debc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ waybar::modules::Clock::Clock(const Json::Value& config)
: ALabel(config, "{:%H:%M}") : ALabel(config, "{:%H:%M}")
{ {
label_.set_name("clock"); label_.set_name("clock");
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 60; uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 60;
thread_ = [this, interval] { thread_ = [this, interval] {
auto now = waybar::chrono::clock::now(); auto now = waybar::chrono::clock::now();
dp.emit(); dp.emit();

View File

@ -4,7 +4,7 @@ waybar::modules::Cpu::Cpu(const Json::Value& config)
: ALabel(config, "{}%") : ALabel(config, "{}%")
{ {
label_.set_name("cpu"); label_.set_name("cpu");
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 10; uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 10;
thread_ = [this, interval] { thread_ = [this, interval] {
dp.emit(); dp.emit();
thread_.sleep_for(chrono::seconds(interval)); thread_.sleep_for(chrono::seconds(interval));

View File

@ -4,7 +4,7 @@ waybar::modules::Memory::Memory(const Json::Value& config)
: ALabel(config, "{}%") : ALabel(config, "{}%")
{ {
label_.set_name("memory"); label_.set_name("memory");
uint32_t interval = config_["interval"] ? config_["inveral"].asUInt() : 30; uint32_t interval = config_["interval"] ? config_["interval"].asUInt() : 30;
thread_ = [this, interval] { thread_ = [this, interval] {
dp.emit(); dp.emit();
thread_.sleep_for(chrono::seconds(interval)); thread_.sleep_for(chrono::seconds(interval));