load average as well
This commit is contained in:
parent
cc402b0e23
commit
9e971469b4
1 changed files with 7 additions and 0 deletions
|
@ -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…
Reference in a new issue