gui: set xkb_layout manually
This commit is contained in:
parent
65238c187f
commit
a67b8f35ba
@ -21,8 +21,6 @@
|
|||||||
# License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
# License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
import qubes.config
|
import qubes.config
|
||||||
import qubes.ext
|
import qubes.ext
|
||||||
|
|
||||||
@ -82,15 +80,14 @@ class GUI(qubes.ext.Extension):
|
|||||||
vm.untrusted_qdb.write('/keyboard-layout', kbd_layout)
|
vm.untrusted_qdb.write('/keyboard-layout', kbd_layout)
|
||||||
|
|
||||||
# Legacy value for setting keyboard layout
|
# Legacy value for setting keyboard layout
|
||||||
try:
|
xkb_keymap = \
|
||||||
xkb_keymap = subprocess.run(['/usr/bin/setxkbmap', '-print'],
|
'xkb_keymap {\x0a\x09xkb_keycodes { include ' \
|
||||||
stdout=subprocess.PIPE,
|
'"evdev"\x09};\x0a\x09xkb_types { include ' \
|
||||||
check=False)
|
'"complete"\x09};\x0a\x09xkb_compat { include ' \
|
||||||
if xkb_keymap.stdout:
|
'"complete"\x09};\x0a\x09xkb_symbols { include ' \
|
||||||
vm.untrusted_qdb.write('/qubes-keyboard', xkb_keymap.stdout)
|
'"pc+%s+inet(evdev)"\x09};\x0a\x09xkb_geometry ' \
|
||||||
except FileNotFoundError:
|
'{ include "pc(pc105)"\x09};\x0a};' % kbd_layout
|
||||||
# Prevent any reason for 'setxkbmap' being not present
|
vm.untrusted_qdb.write('/qubes-keyboard', xkb_keymap)
|
||||||
pass
|
|
||||||
|
|
||||||
# Set GuiVM prefix
|
# Set GuiVM prefix
|
||||||
guivm_windows_prefix = vm.features.get('guivm-windows-prefix', 'GuiVM')
|
guivm_windows_prefix = vm.features.get('guivm-windows-prefix', 'GuiVM')
|
||||||
|
@ -1833,6 +1833,13 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
vm.netvm = None
|
vm.netvm = None
|
||||||
vm.guivm = guivm
|
vm.guivm = guivm
|
||||||
guivm.features['keyboard-layout'] = 'fr'
|
guivm.features['keyboard-layout'] = 'fr'
|
||||||
|
xkb_keymap = \
|
||||||
|
'xkb_keymap {\x0a\x09xkb_keycodes { include ' \
|
||||||
|
'"evdev"\x09};\x0a\x09xkb_types { include ' \
|
||||||
|
'"complete"\x09};\x0a\x09xkb_compat { include ' \
|
||||||
|
'"complete"\x09};\x0a\x09xkb_symbols { include ' \
|
||||||
|
'"pc+fr+inet(evdev)"\x09};\x0a\x09xkb_geometry ' \
|
||||||
|
'{ include "pc(pc105)"\x09};\x0a};'
|
||||||
vm.events_enabled = True
|
vm.events_enabled = True
|
||||||
test_qubesdb = TestQubesDB()
|
test_qubesdb = TestQubesDB()
|
||||||
mock_qubesdb.write.side_effect = test_qubesdb.write
|
mock_qubesdb.write.side_effect = test_qubesdb.write
|
||||||
@ -1843,7 +1850,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
'/name': 'test-inst-appvm',
|
'/name': 'test-inst-appvm',
|
||||||
'/type': 'AppVM',
|
'/type': 'AppVM',
|
||||||
'/default-user': 'user',
|
'/default-user': 'user',
|
||||||
'/qubes-keyboard': unittest.mock.ANY,
|
'/qubes-keyboard': xkb_keymap,
|
||||||
'/keyboard-layout': 'fr',
|
'/keyboard-layout': 'fr',
|
||||||
'/qubes-vm-type': 'AppVM',
|
'/qubes-vm-type': 'AppVM',
|
||||||
'/qubes-gui-domain-xid': '{}'.format(guivm.xid),
|
'/qubes-gui-domain-xid': '{}'.format(guivm.xid),
|
||||||
|
Loading…
Reference in New Issue
Block a user