fix custom intervals causing cpu to go mental

This commit is contained in:
dangerousdan 2018-10-23 00:06:46 +01:00
parent 5a6e05dcde
commit 137c5fb712
No known key found for this signature in database
GPG Key ID: 4CE43E18FABAF672
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}")
{
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] {
auto now = waybar::chrono::clock::now();
dp.emit();

View File

@ -4,7 +4,7 @@ waybar::modules::Cpu::Cpu(const Json::Value& config)
: ALabel(config, "{}%")
{
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] {
dp.emit();
thread_.sleep_for(chrono::seconds(interval));

View File

@ -4,7 +4,7 @@ waybar::modules::Memory::Memory(const Json::Value& config)
: ALabel(config, "{}%")
{
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] {
dp.emit();
thread_.sleep_for(chrono::seconds(interval));