From 4f190db5c5c1c4304a2eaa6d8400b369190ae353 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 20 Jun 2014 16:42:31 +0200 Subject: add dentrystate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/plugins/dentrystate | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/plugins/dentrystate (limited to 'examples') diff --git a/examples/plugins/dentrystate b/examples/plugins/dentrystate new file mode 100644 index 0000000..f57847e --- /dev/null +++ b/examples/plugins/dentrystate @@ -0,0 +1,35 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.dentrystate + +import time +import threading + +from plugins.dentrystate import DentryState +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(): + dentry_ = DentryState() + + data = [('Alloced', dentry_.nr_dentry), + ('Unused', dentry_.nr_unused), + ('AgeLimit', dentry_.age_limit), + ('WantPages', dentry_.want_pages)] + + 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