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.

28 lines
842 B

import plugins
'filename': '/etc/hostname', 'title': 'CAT',
'freq': 60, 'nofile': 'unavailable'
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, FILECAT_DEFAULTS)
self.hide = False
self.format_status(self.conf['title'], False)
def format_status(self, contents, urgent):
self.status['urgent'] = urgent
self.status['full_text'] = self.conf['title'] + ': ' + contents
def main(self):
with open(self.conf['filename'], 'r') as datafile:
contents = datafile.read().strip()
urgent = False
except FileNotFoundError:
contents = self.conf['nofile']
urgent = True
self.format_status(contents, urgent)