From dbacd07b437196d471c43ca38a4400819b8d62a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Mon, 10 Feb 2020 14:42:30 +0100 Subject: [PATCH] gui: handle legacy keymap setting /qubes-keyboard --- qubes/ext/gui.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/qubes/ext/gui.py b/qubes/ext/gui.py index 412ce652..2c7205a3 100644 --- a/qubes/ext/gui.py +++ b/qubes/ext/gui.py @@ -21,6 +21,8 @@ # License along with this library; if not, see . # +import subprocess + import qubes.config import qubes.ext @@ -79,6 +81,16 @@ class GUI(qubes.ext.Extension): if kbd_layout: vm.untrusted_qdb.write('/keyboard-layout', kbd_layout) + # Legacy value for setting keyboard layout + try: + xkb_keymap = subprocess.run(['/usr/bin/setxkbmap', '-print'], + stdout=subprocess.PIPE) + if xkb_keymap.stdout: + vm.untrusted_qdb.write('/qubes-keyboard', xkb_keymap.stdout) + except FileNotFoundError: + # Prevent any reason for 'setxkbmap' being not present + pass + # Set GuiVM prefix guivm_windows_prefix = vm.features.get('guivm-windows-prefix', 'GuiVM') if vm.features.get('service.guivm-gui-agent', None):