Skip to content

Commit

Permalink
Merge pull request #53 from dangerousdan/fix-clock-interval
Browse files Browse the repository at this point in the history
fix custom intervals causing cpu to go mental
  • Loading branch information
Alexays authored Oct 23, 2018
2 parents 5a6e05d + 137c5fb commit da0674d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/modules/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/modules/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit da0674d

Please sign in to comment.