From 0d56006f78ec66b231b16e20d1466dc29391221c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 20 Jun 2014 16:58:39 +0200 Subject: add files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugins/files | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 examples/plugins/files (limited to 'examples') diff --git a/examples/plugins/files b/examples/plugins/files new file mode 100644 index 0000000..56b69fd --- /dev/null +++ b/examples/plugins/files @@ -0,0 +1,34 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.files + +import time +import threading + +from plugins.files import Files +from plugins.clock import Clock + + +OUTPUT, HEIGHT, YPOS, TOP = 0, 12, 24, True + + +clock = Clock(sync_to = Clock.SECONDS) + +start_ = start +def start(): + start_() + async(lambda : clock.continuous_sync(lambda : bar.invalidate())) + + +def redraw(): + files_ = Files() + + data = [('Files', files_.nr_files), + ('Free', files_.nr_free_files), + ('Max', files_.file_max)] + + text = ' │ '.join('%s: %i' % (text, value) for (text, value) in data) + + bar.clear() + bar.draw_coloured_text(0, 10, 0, 2, text) + -- cgit v1.2.3-70-g09d2