2

I'm trying to make a custom keyboard variant for Ubuntu 17.10 with default gnome (Xorg).

In file /usr/share/X11/xkb/symbols/be I added the text below:

partial alphanumeric_keys
xkb_symbols "r03" {

    include "be(basic)"
    name[Group1]="Belgian (r03)";

    key <TLDE>  { [ at, threesuperior, onesuperior, lessthanequal ] };

};

There will be more changes, but this is a test. The key above tab should be '@'.
(My complete layout is available here: https://github.com/r03/azerty#installing-on-linux)

I also changed /usr/share/X11/xkb/rules/evdev.xml to add this new variant to the 'be' layout:

<variant>
  <configItem>
    <name>r03</name>
    <description>Belgian (r03)</description>
  </configItem>
</variant>  

The folder /var/lib/xkb only contains a readme.

When I use setxkbmap -layout be -variant r03 the new keymap seems to work fine.

The problem is that I can't select the new variant when I run sudo dpkg-reconfigure keyboard-configuration. In the gnome settings I can't even select a variant. I tried with the dconf editor to change /org/gnome/desktop/input-sources/sources to [('xkb', 'be+r03')] but then I get a querty layout instead of azerty. (fallback if settings is wrong?)

How can I make my new layout selectable in the settings. I want this as my default keyboard layout (also in gdm).

Update:

I got sudo dpkg-reconfigure keyboard-configuration working, but it is very uggly. (don't do it, just edit /etc/default/keyboard)

Copy the output of this command:

sudo /usr/share/console-setup/kbdnames-maker /usr/share/console-setup/KeyboardNames.pl | grep r03

I should be something like this: C*variant*be*r03*Belgian - Belgian (r03)

Then add this line to this file: (search for similar lines)

sudo vi /var/lib/dpkg/info/keyboard-configuration.config

Now you can select the new variant in dpkg-reconfigure keyboard-configuration.

  • Did you reboot after having made the changes? – Gunnar Hjalmarsson Nov 6 '17 at 21:46
  • yes, but that didn't help. – r03 Nov 6 '17 at 22:30
  • I added the above snippets to my 17.10, and it works fine for me. Found in GNOME settings under "French (Belgium)". – Gunnar Hjalmarsson Nov 6 '17 at 22:59
  • Could you make a screenshot or something? I don't have French (Belgium) only Belgian. – r03 Nov 7 '17 at 7:20
  • I found it, I changed org.gnome.desktop.input-sources show-all-sources back to the default and changed my regional format settings to the correct value. After a reboot I could choose the new variant. Thanks! – r03 Nov 7 '17 at 8:54
1

The manual way to make the custom layout available on the login screen is to edit the /etc/default/keyboard file. Assuming that it currently includes these two lines:

XKBLAYOUT="be"
XKBVARIANT=""

you can e.g. change them to read:

XKBLAYOUT="be,be"
XKBVARIANT="r03,"

After next reboot, a keyboard layout indicator should be visible allowing you to choose betweeen Belgian (r03) and Belgian. Probably the former willl be preselected.

  • Thx, that works as you describe. I think this could also be done with dpkg-reconfigure keyboard-configuration, but there I can't select my new layout variant. – r03 Nov 8 '17 at 18:38
  • @r03: I suspect that the reason is that you didn't edit the evdev.lst file too. But it's a guess; didn't test. – Gunnar Hjalmarsson Nov 8 '17 at 18:51
  • I don't think that is the problem. It looks like the program reads xorg.xml. anonscm.debian.org/cgit/d-i/console-setup.git/tree/Keyboard/… But it's OK. I changed the default keyboard file and it works. – r03 Nov 8 '17 at 23:03
  • @r03: xorg.xml is a symlink pointing to base.xml, so then maybe copying the modified evdev.xml to base.xml would make a difference (for some reason they both exist on Ubuntu and they are identical). – Gunnar Hjalmarsson Nov 9 '17 at 3:27
  • That didn't work. I added an uggly fix in my answer. – r03 Nov 9 '17 at 21:57
2

To make the custom layout selectable also on the login screen, you can go to Settings -> Region & Language, click the Login Screen button at the top right of the window, and add it there as well.

enter image description here

  • I don't see that button? ibb.co/hzP4Sb – r03 Nov 7 '17 at 18:10
  • @r03: I can't see it on that screenshot either. Is your system updated? sudo apt update && sudo apt upgrade – Gunnar Hjalmarsson Nov 7 '17 at 20:26
  • 1
    @r03: Hmm.. I'm confused, and filed bug #1730900. – Gunnar Hjalmarsson Nov 8 '17 at 7:47
  • 1
    @r03: For the sake of completeness: The "Login Screen" button is showed only if you have more than one user accounts on the system. Compare this answer. – Gunnar Hjalmarsson Nov 13 '17 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.