diff options
| author | Mattias Andrée <maandree@operamail.com> | 2014-06-20 16:50:14 +0200 | 
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2014-06-20 16:50:14 +0200 | 
| commit | 8199ab0d31bc4f42c184e369a611d2e55e082eb9 (patch) | |
| tree | 8844e845e473c076506ec846facf1f30d2e52008 /examples | |
| parent | add dentrystate (diff) | |
| download | xpybar-8199ab0d31bc4f42c184e369a611d2e55e082eb9.tar.gz xpybar-8199ab0d31bc4f42c184e369a611d2e55e082eb9.tar.bz2 xpybar-8199ab0d31bc4f42c184e369a611d2e55e082eb9.tar.xz  | |
add inodestate
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/plugins/inodestate | 34 | 
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/plugins/inodestate b/examples/plugins/inodestate new file mode 100644 index 0000000..8abb0ef --- /dev/null +++ b/examples/plugins/inodestate @@ -0,0 +1,34 @@ +# -*- python -*- + +# A xpybar configuration example testing the features of plugins.inodestate + +import time +import threading + +from plugins.inodestate import InodeState +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(): +    inode_ = InodeState() +     +    data = [('Inodes',   inode_.nr_inodes), +            ('Free',    inode_.nr_free_inodes), +            ('Preshrink',  inode_.preshrink)] +     +    text = ' │ '.join('%s: %i' % (text, value) for (text, value) in data) +     +    bar.clear() +    bar.draw_coloured_text(0, 10, 0, 2, text) +  | 
