diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:46:09 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:46:09 +0100 |
commit | 5676d16a459eb97159f10ba242211b1492cf543d (patch) | |
tree | 1ff4a5dd9f73b3b3c36e7e11ae81a55f8120951c /examples | |
parent | fix and use xkb lock keys (diff) | |
download | xpybar-5676d16a459eb97159f10ba242211b1492cf543d.tar.gz xpybar-5676d16a459eb97159f10ba242211b1492cf543d.tar.bz2 xpybar-5676d16a459eb97159f10ba242211b1492cf543d.tar.xz |
plugins.clock demo
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | examples/plugins/clock | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/examples/plugins/clock b/examples/plugins/clock new file mode 100644 index 0000000..4cf1b21 --- /dev/null +++ b/examples/plugins/clock @@ -0,0 +1,27 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.clock + +import time +import threading + +from plugins.clock import Clock + + +OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 24, True + + +clock = Clock(format = '%Y-(%m)%b-%d %T, %a w%V, %Z', utc = True, sync_to = Clock.SECONDS) + + +start_ = start +def start(): + start_() + async(lambda : clock.continuous_sync(lambda : bar.invalidate())) + + +def redraw(): + text = '%s (%f)' % (clock.read(), Clock.posix_time()) + bar.clear() + bar.draw_coloured_text(0, 10, 0, 2, text) + |