xkb/symbols ignored in 12.1?

How do I alter the keyboard layout in 12.1 (KDE)?

In 11.4 I manipulated my keyboard layout by altering the file us in /usr/share/X11/xkb/symbols and deleting the files in /usr/share/X11/xkb/compiled/ and the file /var/ach/hald/fdi-cache. This does not work in 12.1 any more, the changes are ignored, the directory xkb/compiled/ is empty (save for a non-helping readme) and /var/ach/hald/fdi-cache does not exist to be deleted.

Specifically, I am using a US keyboard and want to have the German umlauts ä, ö, ü on Alt-a, Alt-o, Alt-u. I am aware of deadkey, compose-key and intl variants, but all of them are ugly and have been ugly for years.

Ok, its wörking now! :slight_smile:

I just moved the differently named backup copy from /usr/share/X11/xkb/symbols to elsewhere and also executed /usr/share/X11/xkb/xkbcomp on the edited file, although the latter did not seem to have any effect. Nevertheless, a reboot later it worked.

Can you be more precise about “elsewhere”? I’m in the same boat, still using 11.4 for my main work but planning to transfer the modded keyboard layout to 12.1 any day now… What’s changed in 12.1?

Edit: I have the umlaute on the curly and square bracket keys so no need for ALT (which I only use on the rare occasion that I need the brackets). With my name, even the ALT combo quickly gets annoying…

Following worked for me:

First, new variant in /usr/share/X11/xkb/symbols/ru:

// dead acute accent added as AltGr+<AE12>
partial alphanumeric_keys
xkb_symbols "mikko" {
    include "ru(winkeys)"

    name[Group1]= "Russia - Mikko";

    key	<AE12> {		    equal, plus, dead_acute	]	};

    include "level3(ralt_switch)"

Next, new line in /usr/share/X11/xkb/rules/base.lst

! variant
  mikko           ru: Russian (Mikko)

And finally new block in /usr/share/X11/xkb/rules/base.xml:

            <description>Russian (Mikko)</description>

After reboot new variant appears in keyboard layouts.

For those interested: Above modification is used to add acute accents above stressed syllables. These accents are not official part of Russian language, but they are used when studying it. Like this: здра́вствуйте!

Elsewhere meaning a directory used for backups in my home directory. It does not matter where, as long as you do not keep the backup in /usr/share/X11/xkb/symbols, which I used to do so in 11.4 and before, i.e. I copied symbols/us to symbols/us.bak and edited symbols/us according to my tastes. However, apparently the system got confused with the backup being in the same directory.

Actually creating a proper layout as suggested by syrja is surely the better solution, than tweaking the base layout.

Here is another warning, which I omitted in my original post:

  • On one machine with a UK-keyboard, I just copied my tweaked file “gb” into /usr/share/X11/xkb/symbols, rebooted, and everything was fine.
  • On the other machine with US-keyboard, I also copied my tweaked file “us” into /usr/share/X11/xkb/symbols and rebooted and the keyboard was dead. In this case, click in the login manager to start the text console, and the keyboard worked again, allowing me to fix the error. For some reason it did not like my tweaked “us” files that I had used in 11.4. So I opened an editor on the backup “us”-file and redid my tweaks manually. Then the above happened, i.e. my tweaks were ignored until I removed the backup file.

Sorry to take so long to reply, have only just got round to transferring my custom keymap to 12.1. Upon looking at what I’d done in 11.4, I found that I’d used a custom file “.Xmodmap” in the /home directory, and all that was needed was to copy that to the 12.1 /home. Nothing else, not even a script as /etc/X11/xinit/xinitrc.common already tells KDE to read any such files in /home on startup. Seems neater than either of your solutions as it doesn’t require any fiddling with the built-in keymaps, nor any new variants, and can be further modified at any time. I suppose the “drawback” is that it’s per user but as I’m the only one on my computer it doesn’t matter to me…
This, in case anyone’s interested, is what the .Xmodmap file contains:

keycode  34 = adiaeresis Adiaeresis bracketleft braceleft bracketleft braceleft
keycode  35 = udiaeresis Udiaeresis bracketright braceright bracketright braceright
keycode  49 = odiaeresis Odiaeresis grave asciitilde grave asciitilde
keycode  51 = 0x00DF bar backslash bar backslash bar

I just upgraded from openSUSE 13.1 to 13.2 and I’m experiencing the same problem now. Unfortunately, the workarounds posted in this thread don’t work. That is, clearing backup files from /usr/share/X11/xkb/symbols, running xkbcomp on the changed file, and rebooting has no effect. /var/lib/xkb/compiled is also empty.

Does anyone else know how I can force a recompile of my modified xkb symbol file, or do whatever else is necessary to get the system to apply the changes? (I see that xkbcomp is invoked in several scripts in /etc/X11/xdm, though it’s not immediately clear to me if/how this information is useful.)

(I should add that I’m referring to the problem of modifying an existing keyboard layout, not adding a new one. I do tweak my custom keyboard layout from time to time and don’t want to add a new entry for every minor revision of it.)