diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:30:51 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-06 23:30:51 +0100 |
commit | a0763e0442c998db9f71074b35ba9a3376357bae (patch) | |
tree | f1bd43a5e69eb00bd3d449f9260d0c7fd2b9f306 /examples | |
parent | m (diff) | |
download | xpybar-a0763e0442c998db9f71074b35ba9a3376357bae.tar.gz xpybar-a0763e0442c998db9f71074b35ba9a3376357bae.tar.bz2 xpybar-a0763e0442c998db9f71074b35ba9a3376357bae.tar.xz |
fix and use xkb lock keys
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plugin-test | 9 |
1 files changed, 7 insertions, 2 deletions
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) |