mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Merge pull request #53 from dangerousdan/fix-clock-interval
fix custom intervals causing cpu to go mental
This commit is contained in:
commit
da0674debc
@ -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
Block a user