aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-01 10:48:19 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-01 10:48:19 +0100
commit9acbaee29b2ea501a0132a85e4c6c190c1c5c5aa (patch)
tree3d891e719c58a47ae974410fede88dd91216a4c7 /examples
parentadd delay parameter to watch (diff)
downloadxpybar-9acbaee29b2ea501a0132a85e4c6c190c1c5c5aa.tar.gz
xpybar-9acbaee29b2ea501a0132a85e4c6c190c1c5c5aa.tar.bz2
xpybar-9acbaee29b2ea501a0132a85e4c6c190c1c5c5aa.tar.xz
add uname
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/plugin-test14
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/plugin-test b/examples/plugin-test
index db316ee..d9ead29 100644
--- a/examples/plugin-test
+++ b/examples/plugin-test
@@ -7,6 +7,7 @@ import os
from plugins.uptime import Uptime
from plugins.loadavg import AverageLoad
from plugins.users import Users
+from plugins.uname import Uname
OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True
@@ -15,6 +16,8 @@ OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True
def redraw():
bar.clear()
+ time = spawn_read('date', '+%Y-(%m)%b-%d %T, %a w%V, %Z')
+
uptime_ = Uptime()
uptime = '%id %02i:%02i:%0.2f' % uptime_.uptime
tot_idle = '%id %02i:%02i:%0.2f' % uptime_.total_idle
@@ -41,9 +44,14 @@ def redraw():
users = ['%s{%i}' % (colour_user(u) % u, len(users_[u])) for u in users_.keys()]
users = 'Users: %s' % (' '.join(users))
- time = spawn_read('date', '+%Y-(%m)%b-%d %T, %a w%V, %Z')
+ uname_ = Uname()
+ nodename = uname_.nodename
+ kernel_release = uname_.kernel_release
+ operating_system = uname_.operating_system
+ uname = '%s %s %s'
+ uname %= (nodename, kernel_release, operating_system)
- text = '%s │ %s │ %s │ %s │ %s'
- text %= (time, uptime, idle, loadavg, users)
+ text = '%s │ %s │ %s │ %s │ %s │ %s'
+ text %= (time, uptime, idle, loadavg, users, uname)
bar.draw_coloured_text(0, 10, 0, 2, text)