From 040cd0ddc3256b1e4b7950abb8a5d60b2a80f2fd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 13 Jun 2014 17:26:07 +0200 Subject: fix line reader and add kmsg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugins/kmsg | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/plugins/kmsg (limited to 'examples') 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) + -- cgit v1.2.3-70-g09d2