aboutsummaryrefslogtreecommitdiffstats
path: root/examples/plugins/ropty
diff options
context:
space:
mode:
Diffstat (limited to 'examples/plugins/ropty')
-rw-r--r--examples/plugins/ropty13
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)