fix custom intervals causing cpu to go mental
parent
5a6e05dcde
commit
137c5fb712
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue