config: barpyrus: config.py: add keyboard layout switcher
There are now several keyboard layouts to switch to with the click of a button. In order to not make the panel too crowded the available layouts are hidden behind a ShortLongLayout which allows to make them visible only when necessary.
This commit is contained in:
parent
7f624d2742
commit
e31c496951
1 changed files with 15 additions and 0 deletions
|
|
@ -49,6 +49,14 @@ def frame(content, bg, fg, padding = (3, 3)):
|
|||
# conky specific configuration
|
||||
conky_text = ''
|
||||
|
||||
# options for hlwm.HLWMLayoutSwitcher widget
|
||||
xkblayouts = [
|
||||
'us us -variant altgr-intl us'.split(' '),
|
||||
'de de de'.split(' '),
|
||||
]
|
||||
setxkbmap = 'setxkbmap -option compose:menu -option ctrl:nocaps'
|
||||
setxkbmap += ' -option compose:ralt -option compose:rctrl'
|
||||
|
||||
# get space for the panel
|
||||
hc(['pad', str(monitor), str(height)])
|
||||
|
||||
|
|
@ -70,5 +78,12 @@ bar.widget = W.ListLayout([
|
|||
|
||||
W.RawLabel('%{r}'),
|
||||
conky.ConkyWidget(text = conky_text),
|
||||
W.ShortLongLayout(
|
||||
W.RawLabel(''),
|
||||
W.ListLayout([
|
||||
hlwm.HLWMLayoutSwitcher(hc, xkblayouts, command = setxkbmap.split(' ')),
|
||||
W.RawLabel(' '),
|
||||
])
|
||||
),
|
||||
frame(W.DateTime('%d. %B, %H:%M'), 'grey', 'white'),
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue