From 20c1782f7865b5f96b1650a65097a0e2bdd1241e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 7 Mar 2014 00:16:52 +0100 Subject: fix and demo cpuonline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugins/cpuonline | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 examples/plugins/cpuonline (limited to 'examples/plugins') diff --git a/examples/plugins/cpuonline b/examples/plugins/cpuonline new file mode 100644 index 0000000..1796b22 --- /dev/null +++ b/examples/plugins/cpuonline @@ -0,0 +1,21 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.chase + +import time +import threading + +from plugins.cpuonline import CPUOnline + + +OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 24, True + + +def redraw(): + cpu = CPUOnline() + s = lambda cpus : ', '.join([str(i) for i in cpus]) + text = 'Online: %s │ Offline: %s │ Present: %s │ Possible: %s' + text %= s(cpu.online), s(cpu.offline), s(cpu.present), s(cpu.possible) + bar.clear() + bar.draw_coloured_text(0, 10, 0, 2, text) + -- cgit v1.2.3-70-g09d2