diff --git a/config/barpyrus/config.py b/config/barpyrus/config.py index c5c5c30..44b28e8 100644 --- a/config/barpyrus/config.py +++ b/config/barpyrus/config.py @@ -108,6 +108,19 @@ setxkbmap += ' -option compose:ralt -option compose:rctrl' def frame(content, bg, fg, padding = (3, 3)): return Theme(bg = color[bg], fg = color[fg], padding = padding)(content) +# renderer for the keyboard selection +def kbd_renderer(self, painter): + if self.label == '0': + painter.fg(color['lightgrey']) + painter.symbol(0xe26f) + painter.space(8) + else: + painter.fg(color['cyan']) + painter.bg(color['grey']) + painter.space(8) + painter.symbol(0xe26f) + painter.space(8) + # get space for the panel hc(['pad', str(monitor), str(height)]) @@ -129,12 +142,11 @@ bar.widget = W.ListLayout([ W.RawLabel('%{r}'), conky.ConkyWidget(text = conky_text), - W.ShortLongLayout( - W.RawLabel(''), - W.ListLayout([ + W.TabbedLayout([ + ('0', W.RawLabel('')), + ('1', W.ListLayout([ hlwm.HLWMLayoutSwitcher(hc, xkblayouts, command = setxkbmap.split(' ')), - W.RawLabel(' '), - ]) - ), + W.RawLabel(' ')])) + ], tab_renderer = kbd_renderer), frame(W.DateTime('%d. %B, %H:%M'), 'grey', 'white'), ])