diff --git a/README.md b/README.md index d4bda2a..8859b47 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ battery status This class shows a clock -* format +* format — stftime format string ### mail diff --git a/i3pystatus/clock.py b/i3pystatus/clock.py index 4e48bb8..e450ed2 100644 --- a/i3pystatus/clock.py +++ b/i3pystatus/clock.py @@ -10,8 +10,11 @@ class Clock(IntervalModule): This class shows a clock """ - settings = ("format",) + settings = ( + ("format", "stftime format string"), + ) format = None + interval = 1 def init(self): if self.format is None: @@ -38,9 +41,8 @@ class Clock(IntervalModule): self.format = "%a %-d %b %X" def run(self): - full_text = datetime.datetime.now().strftime(self.format) self.output = { - "full_text": full_text, + "full_text": datetime.datetime.now().strftime(self.format), "name": "pyclock", "urgent": False, "color": "#ffffff"