Added mechanism to skip updates in a module

* This is useful in modules where HTTP API calls are made. Updating them
  every second is expensive, network intensive and can cause rate limits
  to be hit
* Added get_name() function to modules for easier debug statements
This commit is contained in:
2025-06-14 17:33:24 -07:00
parent e8ab11eff9
commit 7245914da8
11 changed files with 92 additions and 3 deletions

View File

@@ -116,6 +116,11 @@ impl UnibarModuleCpu {
impl bar_modules::BarModuleActions for UnibarModuleCpu {
// --------------------
fn get_name(&self) -> String {
return "UnibarModuleCpu".to_string();
}
// --------------------
fn clear(&mut self) {
self.cpu_times_sample_1 = CpuTimes::new();