mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-10-31 07:52:42 +01:00 
			
		
		
		
	feat(config): interval for cpu and memory modules
This commit is contained in:
		| @@ -7,7 +7,8 @@ waybar::modules::Cpu::Cpu(Json::Value config) | |||||||
|   _label.get_style_context()->add_class("cpu"); |   _label.get_style_context()->add_class("cpu"); | ||||||
|   _thread = [this] { |   _thread = [this] { | ||||||
|     update(); |     update(); | ||||||
|     _thread.sleep_for(chrono::seconds(10)); |     int interval = _config["interval"] ? _config["inveral"].asInt() : 10; | ||||||
|  |     _thread.sleep_for(chrono::seconds(interval)); | ||||||
|   }; |   }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -7,7 +7,8 @@ waybar::modules::Memory::Memory(Json::Value config) | |||||||
|   _label.get_style_context()->add_class("memory"); |   _label.get_style_context()->add_class("memory"); | ||||||
|   _thread = [this] { |   _thread = [this] { | ||||||
|     update(); |     update(); | ||||||
|     _thread.sleep_for(chrono::seconds(30)); |     int interval = _config["interval"] ? _config["inveral"].asInt() : 30; | ||||||
|  |     _thread.sleep_for(chrono::seconds(interval)); | ||||||
|   }; |   }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexis
					Alexis