I'm using a US keyboard layout, but occasionally need to type German umlauts. So far I used .Xmodmap with definitions like this
keycode 133 = Mode_switch NoSymbol Mode_switch
keycode 38 = a A adiaeresis Adiaeresis aacute Aacute
keycode 39 = s S ssharp ssharp ssharp section
where I can reach the umlauts and the sharp s via the Windows key plus a/o/u/s. How can I achieve exactly (really got used to it...) the same behavior with the new xkb system (config file /usr/share/X11/xkb/symbols/pc
). It looks even more complicated than Xmodmap.
I would appreciate any help.
After some unsuccessful attempts to add my own local xkb/symbols file (see https://askubuntu.com/a/896298/883344 and https://askubuntu.com/a/896297/883344), I went for the solution from https://stackoverflow.com/a/45042841/3852630. By running
I see that my current layout is
us
. I dump this layout to my own file and make a copyand modified the copy as seen here
I wrote a small shell script which is located somewhere in my search path which contains the line
Whenever I want to switch to my layout with German umlauts, I run this script. I switch back to the default keyboard mapping by
As mentioned in my comment above, I now use AltGr to switch a/o/u/s to ä/ö/ü/ß (decided to reprogram my brain to use AltGr instead of the Windows key which seems to have a special meaning in the Gnome 3 desktop). As described in https://blog.florianheinle.de/englische-tastatur-umlaute (in German), AltGr can be used for switching by starting
gnome-tweaks
, then going toKeyboard&Mouse -> Additional Layout Options -> Key to choose the 3rd level
, and selectingright alt
.The alternative is of course to modify the file
us
in/usr/share/X11/xkb/symbols
, but this may get overwritten at the next update. Anyhow, that would be thediff
between the newus
file and the old (same name):