From 25ce17855fd4c5d35b7e68b65c4743f2f208ccc2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 2 Mar 2014 23:13:28 +0100 Subject: add moc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugin-test | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'examples/plugin-test') diff --git a/examples/plugin-test b/examples/plugin-test index 06891cf..0a0113d 100644 --- a/examples/plugin-test +++ b/examples/plugin-test @@ -13,6 +13,7 @@ from plugins.df import Discs from plugins.mem import Memory from plugins.discstats import DiscStats from plugins.xdisplay import XDisplay +from plugins.moc import MOC OUTPUT, HEIGHT, YPOS, TOP = 0, 24, 24, True @@ -148,7 +149,12 @@ def redraw(): xdisplay = ':%i' % XDisplay().display - text = '%s │ %s │ %s │ %s │ %s │ %s %s │ %s │ %s │ %s\n%s │ %s' - text %= (time, uptime, idle, loadavg, users, uname, xdisplay, mem, swp, shm, discs, discstats) + moc_ = MOC().state + moc = {None : 'dead', MOC.STOPPED : 'stopped', MOC.PAUSED : 'paused', MOC.PLAYING : 'playing'} + moc = 'Moc: %s' % moc[moc_] + + + text = '%s │ %s │ %s │ %s │ %s │ %s %s │ %s │ %s │ %s │ %s\n%s │ %s' + text %= (time, uptime, idle, loadavg, users, uname, xdisplay, mem, swp, shm, moc, discs, discstats) bar.draw_coloured_text(0, 10, 0, 2, text) -- cgit v1.2.3-70-g09d2