From be41c94c5707729f54c99b8f551eb6be890f0c91 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 31 Aug 2020 16:02:04 +0200 Subject: [PATCH] pmb.install.setup_keymap: Fix up keymaps for Nokia n900 (MR 1972) The Nokia n900 XkbLayout is a bit peculiar and sometimes join two keymaps into one, for example: Option "XkbLayout" "fise" For the combined finnish/swedish layout. Add the common joined keymaps, even if not all of these countries are yet supported. For details see: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/blob/master/symbols/nokia_vndr/rx-51 I also include this link in the code so no-one gets confused. Signed-off-by: Linus Walleij --- pmb/install/_install.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 2b46fe1c..5a723e99 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -300,6 +300,15 @@ def setup_keymap(args): "/etc/X11/xorg.conf.d/"], suffix, check=False, output_return=True) if config: + # Nokia n900 (RX-51) randomly merges some keymaps so we + # have to specify a composite keymap for a few countries. See: + # https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/blob/master/symbols/nokia_vndr/rx-51 + if variant == "rx51_fi" or variant == "rx51_se": + layout = "fise" + if variant == "rx51_da" or variant == "rx51_no": + layout = "dano" + if variant == "rx51_pt" or variant == "rx51_es": + layout = "ptes" # Multiple files can contain the keyboard layout, take last config = config.splitlines()[-1] old_text = "Option *\\\"XkbLayout\\\" *\\\".*\\\""