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/roelandm/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.

roel4d
  • 455
  • 1
  • 4
  • 10

2 Answers2

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

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.