diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-06-13 17:26:07 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-06-13 17:26:07 +0200 |
commit | 040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd (patch) | |
tree | d5893dab5e51f3485cf2d2754e45c49bb7956259 /examples/plugins | |
parent | add ipaddress (diff) | |
download | xpybar-040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd.tar.gz xpybar-040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd.tar.bz2 xpybar-040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd.tar.xz |
fix line reader and add kmsg
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples/plugins')
-rw-r--r-- | examples/plugins/kmsg | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/plugins/kmsg b/examples/plugins/kmsg new file mode 100644 index 0000000..bb2ddff --- /dev/null +++ b/examples/plugins/kmsg @@ -0,0 +1,30 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.kmsg + +from plugins.kmsg import KMsg + + +OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 24, True + +text = '' +kmsg_ = KMsg() + +start_ = start +def start(): + start_() + def refresh(): + global text + text = kmsg_.next() + if text is None: + text = '' + bar.invalidate() + import sys + sys.exit() # kill thread + bar.invalidate() + async(lambda : forever(refresh)) + +def redraw(): + bar.clear() + bar.draw_coloured_text(0, 10, 0, 2, text) + |