aboutsummaryrefslogtreecommitdiffstats
path: root/examples/plugins/kmsg
diff options
context:
space:
mode:
Diffstat (limited to 'examples/plugins/kmsg')
-rw-r--r--examples/plugins/kmsg30
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)
+