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.
 

20 lines
559 B

import datetime
import plugins
DATE_DEFAULTS = {'format': '%c'}
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, DATE_DEFAULTS)
self.timezone = None
if 'tz' in self.conf:
import pytz
self.timezone = pytz.timezone(self.conf['tz'])
def main(self):
now = datetime.datetime\
.now(tz=self.timezone)\
.strftime(self.conf['format'])
self.format_status(now)