A simple replacement for i3status that is both extensible and customizable.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
558 B

import os
import plugins
LOAD_DEFAULTS = {'title': 'LOAD', 'freq': 20, 'problem': 1}
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, LOAD_DEFAULTS)
def main(self):
loads = os.getloadavg()
if loads[0] >= self.conf['problem']:
self.hide = False
urgent = True
else:
self.hide = True
urgent = False
status = '{:.2f} {:.2f} {:.2f}'.format(*loads)
self.format_status(status, urgent)