Merge pull request #337 from MartinWallgren/master
[modules/layout-xkb] use XKeyboard to set layout
This commit is contained in:
commit
4bb10d6ea4
1 changed files with 3 additions and 8 deletions
|
@ -43,14 +43,9 @@ class Module(bumblebee.engine.Module):
|
|||
|
||||
xkb = XKeyboard()
|
||||
if xkb.groups_count < 2: return # nothing to doA
|
||||
|
||||
layouts = xkb.groups_symbols[rotation:] + xkb.groups_symbols[:rotation]
|
||||
variants = xkb.groups_variants[rotation:] + xkb.groups_variants[:rotation]
|
||||
|
||||
try:
|
||||
bumblebee.util.execute("setxkbmap -layout {} -variant {}".format(",".join(layouts), ",".join(variants)))
|
||||
except RuntimeError:
|
||||
pass
|
||||
layouts = xkb.groups_symbols
|
||||
idx = layouts.index(xkb.group_symbol)
|
||||
xkb.group_symbol = str(layouts[(idx + rotation) % len(layouts)])
|
||||
|
||||
def current_layout(self, widget):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue