From 9acbaee29b2ea501a0132a85e4c6c190c1c5c5aa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 1 Mar 2014 10:48:19 +0100 Subject: add uname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugin-test | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'examples/plugin-test') 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) -- cgit v1.2.3-70-g09d2