From a0763e0442c998db9f71074b35ba9a3376357bae Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 6 Mar 2014 23:30:51 +0100 Subject: fix and use xkb lock keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugin-test | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'examples/plugin-test') diff --git a/examples/plugin-test b/examples/plugin-test index a012542..5c5d84a 100644 --- a/examples/plugin-test +++ b/examples/plugin-test @@ -18,6 +18,7 @@ from plugins.moc import MOC from plugins.cpu import CPU from plugins.clock import Clock from plugins.network import Network +from plugins.xkb import XKB OUTPUT, HEIGHT, YPOS, TOP = 0, 3 * 12, 24, True @@ -187,14 +188,18 @@ def redraw(): net_total = '%.2fGB|%.2fGB' % (sum([rx for _, rx, tx in net_]), sum([tx for _, rx, tx in net_])) net = '%s : %s' % (' '.join(net_each), net_total) + xkb_ = XKB() + locks = ' '.join([x.lower() for x in xkb_.get_locks_str()]) + xkb = 'Xkb:%s' % ('' if len(locks) == 0 else ' ' + locks) + text = ['%s │ %s │ %s │ %s │ %s │ %s %s │ %s │ %s │ %s │ %s' ,'%s │ %s │ %s' - ,'%s'] + ,'%s │ %s'] text = '\n'.join(text) text %= (date, uptime, idle, loadavg, users, uname, xdisplay, mem, swp, shm, moc, discs, discstats, cpu, - net) + net, xkb) bar.clear() bar.draw_coloured_text(0, 10, 0, 2, text) -- cgit v1.2.3-70-g09d2