hiding load average in ok status is now optional

This commit is contained in:
Von Random 2016-11-03 18:59:00 +03:00
parent d2ded008d2
commit 9db9a935d4
2 changed files with 3 additions and 2 deletions

View file

@ -5,7 +5,7 @@ format = i3
plugin = ping
hosts = de-ber-as20647.anchors.atlas.ripe.net,nl-ams-as1101.anchors.atlas.ripe.net,uk-boh-as196745.anchors.atlas.ripe.net
title = NET
colors = #00FF00,#FF0000
hide_ok = true
[memory]
plugin = mem

View file

@ -12,6 +12,7 @@ class PluginThread(threading.Thread):
if config.has_option(section, 'color'):
self.status['color'] = config.get(section, 'color')
self.freq = config.getint(section, 'freq', fallback=10)
self.hide_ok = config.getboolean(section, 'hide_ok', fallback=False)
self.hide = False
self.problem_value = config.getint(section, 'problem', fallback=100)
@ -21,7 +22,7 @@ class PluginThread(threading.Thread):
self.hide = False
self.status['urgent'] = True
else:
self.hide = True
self.hide = self.hide_ok
self.status['urgent'] = False
loads = [str(i) for i in loads]
self.status['full_text'] = 'LA: ' + ' '.join(loads)