diff options
author | Von Random <von@vdrandom.org> | 2016-10-31 15:20:07 +0300 |
---|---|---|
committer | Von Random <von@vdrandom.org> | 2016-10-31 15:20:07 +0300 |
commit | 9e971469b4f1557fb8564da68cdf42af8b0ed7f8 (patch) | |
tree | f1a5d466718877d701409746ba18a594082b96fc | |
parent | cc402b0e23b9b78c4ea47f7a25638219e2a1aced (diff) |
load average as well
-rw-r--r-- | plugins/load.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/load.py b/plugins/load.py index 5f19889..5a01cf0 100644 --- a/plugins/load.py +++ b/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) |