Browse Source

load average as well

master
Von Random 6 years ago
parent
commit
9e971469b4
  1. 7
      plugins/load.py

7
plugins/load.py

@ -13,9 +13,16 @@ class PluginThread(threading.Thread):
self.status['color'] = config.get(section, 'color')
self.freq = config.getint(section, 'freq', fallback=10)
self.hide = False
self.problem_value = config.getint(section, 'problem', fallback=100)
def main(self):
loads = os.getloadavg()
if loads[0] >= self.problem_value:
self.hide = False
self.status['urgent'] = True
else:
self.hide = True
self.status['urgent'] = False
loads = [str(i) for i in loads]
self.status['full_text'] = 'LA: ' + ' '.join(loads)

Loading…
Cancel
Save