qvm-start-daemon: allow multiple options in keyboard layout

This commit is contained in:
Frédéric Pierret (fepitre) 2020-03-17 15:27:58 +01:00
parent 023d94a0b3
commit 2e72f75611
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -127,7 +127,9 @@ def set_keyboard_layout(vm):
xkb_rules_names = subprocess.check_output(
['xprop', '-root', '_XKB_RULES_NAMES']).decode()
xkb_parsed = re.match(xkb_re, xkb_rules_names)
xkb_layout = [x.split(',')[0] for x in xkb_parsed.groups()[2:5]]
xkb_layout = [x.split(',')[0] for x in xkb_parsed.groups()[2:4]]
# We keep all options
xkb_layout.append(xkb_parsed.group(5))
keyboard_layout = '+'.join(xkb_layout)
vm.features['keyboard-layout'] = keyboard_layout
except subprocess.CalledProcessError as e: