diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-03-29 01:06:31 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-03-29 01:06:31 +0100 |
commit | f3f76e9b47492b60f9fc6e7735be332d36b97eaa (patch) | |
tree | 85bbc01a3c11b65790e839fa578c618336075191 /examples/plugins/ropty | |
parent | add get_event_mask and get_override_redirect (diff) | |
download | xpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.gz xpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.bz2 xpybar-f3f76e9b47492b60f9fc6e7735be332d36b97eaa.tar.xz |
small fixes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples/plugins/ropty')
-rw-r--r-- | examples/plugins/ropty | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/plugins/ropty b/examples/plugins/ropty index 5e41351..8c9c845 100644 --- a/examples/plugins/ropty +++ b/examples/plugins/ropty @@ -1,6 +1,6 @@ # -*- python -*- -# A xpybar configuration example testing the features of plugins.kmsg +# A xpybar configuration example testing the features of plugins.ropty from plugins.ropty import ROPTY @@ -15,12 +15,11 @@ def start(): global pty_ start_() def refresh(): - if pty_.size() == 0: - text = '' - else: - line = pty_.next - text = '\033[37;41m%i\033[00m%s' - text %= (pty_.size(), line) + global text + line = pty_.next() + if line == '': + return + text = '\033[37;41m%i\033[00m%s' % (pty_.size(), line.replace('\x07', '')) bar.invalidate() pty_ = ROPTY(refresh) |