Score:1

Where is the upstream source repository for keyboard layouts used in Ubuntu?

us flag

I am aware keyboard layouts in Ubuntu are set in two different places: keyboard-configuration/keyboard-setup take effect only on ttys and the logon screen (at a minimum in MATE, not sure about other flavors), and there is a GUI in system settings which affects only the desktop session.

Where can I find the upstream source repositories for the keyboard layouts used (both tty and desktop session) in Ubuntu? If there are differences between versions and flavors, I am specifically interested in Ubuntu MATE 20.04. Right now I don’t even know which packages (or even files on my local systems) to look for.

Score:1
us flag

As per /usr/share/doc/keyboard-configuration/README.Debian:

In Debian the default keyboard layout is shared between the console and X. It is specified in /etc/default/keyboard.

The comments in /etc/default/keyboard (where the keyboard layout for tty is configured) state:

If you don't want to use the XKB layout on the console, you can specify an alternative keymap. Make sure it will be accessible before /usr is mounted.

There are some layout-related files in /etc/console-setup/*.kmap.gz. Their names start with cached, and the timestamp indicates that they are likely auto-generated when setting the keyboard layout. So non-XKB layouts seem to have no practical relevance, at least on a system with a GUI (not 100% sure about console-only systems; feel free to add that information if you have it).

In short, the keyboard layout files for tty and GUI are the same.

The actual keyboard layouts and related files are stored in /usr/share/X11/xkb/. The symbols dir holds the key mappings (i.e. which physical key generates which character when pressed, alone or with modifiers), and rules/evedv.xml appears to be the map of keyboard layouts.

The source code is at https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config.

N0rbert avatar
zw flag
Addition, MATE part is at https://github.com/mate-desktop/mate-control-center/tree/master/capplets/keyboard .
us flag
If you are looking for the config UI, then that is the place to go to. What I was looking for is the actual keyboard layouts.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.