Allow it to configure side

This commit is contained in:
ZyX 2015-02-20 16:15:21 +03:00
parent eda9d0d607
commit bf228943ed
1 changed files with 3 additions and 2 deletions

View File

@ -13,16 +13,17 @@ class QTilePowerline(Powerline):
class PowerlineTextBox(TextBox):
def __init__(self, timeout=2, text=' ', width=CALCULATED, **config):
def __init__(self, timeout=2, text=' ', width=CALCULATED, side='right', **config):
super(PowerlineTextBox, self).__init__(text, width, **config)
self.timeout_add(timeout, self.update)
self.side = side
powerline = QTilePowerline(ext='wm', renderer_module='pango_markup')
powerline.setup(self)
def update(self):
if not self.configured:
return True
self.text = self.powerline.render(side='right')
self.text = self.powerline.render(side=self.side)
self.bar.draw()
return True