How to customize keyboard layout in PureOS?


#1

I am used to type us-dvorak keybord layout, but also have to write some German texts regularly.
In order to get the German umlauts I usually redefine the caps-lock key to be dead_diaeresis/Multi_key in order to quickly get my umlauts without much effort.

On PureOS it seems like the usual setxkbmap/xmodmap approach does not work.
Why is this? (Wayland?)

But essentially: What is the best way to customize my keyboard layout in PureOS?


#2

Seems like you can see your current gnome keyboard configuration with:

dconf dump /org/gnome/desktop/input-sources/

According to that output it indeed uses the xkb database.
Therefore I ended up in modifying /usr/share/X11/xkb/symbols/capslock and setting the appropriate xkb-option in dconf above.

It does not feel good to to manually modify system resources in /usr/share/ but it works for now.


#3

Hello
can you be more specific whar you did?
my dabblings with what usually works for me yielded nothing so far…
the caps lock is driving me crazy so if i could turn it from “most annoying counterproductive item ever invented”
to something actually useful, like giving me access to umlaut and dead letter accents, that would be really great!

Thanks in advance


#4

I do not know michas solution.
And I need to admit, that the solution below is a pretty dirty one, I am simply too lazy to edit and get through 4 to 5 files for making a fully customized keyboard layout.
From your Name I assume you are a German speaking guy, so I concentrate on the German Umlauts.

Change your keyboard layout from “us” to “us international”.

What you have already achieved by that is that you get:

<alt-r> <a> = á
<shift><alt-r><a> = Á
<alt-r> <u> = ú
<shift><alt-r><u> = Ú

That’s convenient for the French but not really for Germans.
You can solve that by adjusting the “us international” keyboard layout:

sudo nano /usr/share/X11/xkb/symbols/us

This “us” keyboard file carries all variants of the us keyboard, also “us international”
In the file search for:

name[Group1]= “English (US, international with dead keys)”;

below that is the definition for “us international” only change the keys listed below and leave all others untouched:

     key <AD01> { [	   q,          Q,        aacute,           Aacute ] };
     
     key <AD06> { [	   y,          Y,        uacute,           Uacute ] };
     key <AD07> { [	   u,          U,    udiaeresis,       Udiaeresis ] };
 
     key <AD09> { [	   o,          O,    odiaeresis,       Odiaeresis ] };
     key <AD10> { [	   p,          P,        oacute,           Oacute ] };
 
     key <AC01> { [	   a,          A,    adiaeresis,       Adiaeresis ] };
 
     key <AC11> { [apostrophe,   quotedbl,    dead_acute,    dead_diaeresis] };

in addition replace the line with (ralt_switch) with:

include “level3(caps_switch)”

what you have achieved now is:

<caps><a> = ä
<shift><caps><a>=Ä
<caps><u> = ü
<shift><caps><u>=Ü
<caps><o> = ö
<shift><caps><o>=Ö

So the Umlaut is on the “correct” key now and the normally useless, nerving <caps> turns into a convenient replacement for the inconvenient <altr>
I hope that dirty solution brings alt least just a little bit relief …
Finally backup your changes also under another filename, such as e.g. “my_us.backup”
This allows quick recovery, in case the changes in “us” get overwritten by an update.
As said: A dirty solution …