From db7cf58ac21627b5ad851c1e738725d824fceac7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 28 Feb 2014 20:50:53 +0100 Subject: add uptime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugin-test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/plugin-test (limited to 'examples/plugin-test') diff --git a/examples/plugin-test b/examples/plugin-test new file mode 100644 index 0000000..fda91aa --- /dev/null +++ b/examples/plugin-test @@ -0,0 +1,20 @@ +# -*- python -*- + +# A simple xpybar configuration example that tests the plugins + +from plugins.uptime import Uptime + +OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True + +def redraw(): + bar.clear() + + uptime_ = Uptime() + uptime = '%id %02i:%02i:%0.2f' % uptime_.uptime + tot_idle = '%id %02i:%02i:%0.2f' % uptime_.total_idle + avg_idle = '%id %02i:%02i:%0.2f' % uptime_.average_idle + + text = 'Uptime: %s │ Idle time: %s %s' + text %= (uptime, tot_idle, avg_idle) + bar.draw_coloured_text(0, 10, 0, 2, text) + -- cgit v1.2.3-70-g09d2