QWERTY for Western European languages

Picture of Western European with altgr dead keys layout (screenshot of 'gkbd-keyboard-display -l us?altgr-weur')

The altgr-weur layout on Linux

Using the Gnome GUI (graphic user interface) tools

First, you need to enable selecting more layouts than the popular ones. This can be done by throwing the switch Show Extended Input Sources in 'gnome-tweaks', under Keyboard & Mouse.

gnome-tweaks

You may need to install 'gnome-tweaks' first:

sudo apt install gnome-tweaks

Next, start gnome-control-center (the 'main' settings tool for Gnome).

gnome-control-center

To select the layout, find Region & Language or Keyboard, click "+" to add an input source, choose English(US) as your QWERTY keyboard, followed by Western European AltGr dead keys. The layout(s) can be activated by pressing the Super (or Windows) key and the space bar. (An IBM model M lacks that key: head over to keyboard settings in Devices->Keyboard and select another keyboard shortcut for "Switch to next input source", or use your CapsLock as Super key.)

Using a terminal session: altgr-weur just this session, for the current user

Quick and easy: copy the line below and paste in a terminal:

wget -q -O - https://altgr-weur.eu/altgr-weur.sh | bash

Once you're done testing: log out, log in again and your keyboard layout will be back the way it was.

The command above will download a small script ('program') with the manual procedure (below) and start executing it right away. Do this only if you think that altgr-weur.sh does not contain malware. It doesn't, but I wouldn't take anyone's word for it (hint: use the hyperlink to see what's in it).

You could do this 'manually': Make a directory (inside the hidden .config directory) to hold two files. Download the layout (file: altgr-weur) and the keyboard setup (file: map):

mkdir -p $HOME/.config/xkb/symbols/
wget -O $HOME/.config/xkb/symbols/altgr-weur \
    https://altgr-weur.eu/altgr-weur
wget -O $HOME/.config/xkb/map \
    https://altgr-weur.eu/map

Next, compile and activate the new map for the current display ($DISPLAY):

xkbcomp -w 0 -I$HOME/.config/xkb $HOME/.config/xkb/map $DISPLAY

"Success" means there is no further output. Press AltGr+'d': you should see é (and not ð - if you were using altgr-intl before). The right Ctrl key serves as Multi_Key (or Compose) key. Once you're done testing: log out, log in again and your keyboard layout will be back the way it was. (The two small files will remain - for the next session, repeating just the xkbcomp command will suffice.)

The Linux 'user' version of AltGr-WEur is kindly provided by Enno Nagel.

Using a terminal session: altgr-weur every session, for all users that want it

You will need superuser access and you will need to know where the X11 directory is on your distribution for this to work (this directory is not the same on all distros). Change your current directory and start editing the file 'us' as superuser (you are now warned). (Substitute 'nano' with any other text editor you like: gedit (graphical), vi (die-hards), ...)

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

Insert altgr-weur just below altgr-intl (or at the very bottom of the file)

cd /usr/share/X11/xkb/rules
sudo nano evdev.xml

Insert altgr-weur_evdev.xml just below the section of altgr-intl

sudo nano xorg.lst

Add the following line just below altgr-intl

altgr-weur us: English (Western European AltGr dead keys)

Now, you have modified the config files, but the different tools need to pick up the changes. On some (Debian based) distros you could:

sudo dpkg-reconfigure xkb-data

...but a reboot seems to work on all distros. Next, you will need to select the new layout for your keyboard as described above, with one difference: you will find the "English (Western European AltGr dead keys)" layout in the

gnome-control-center

without the need to enable extended inputs in gnome-tweaks. You could lose the edits once the file "us" is replaced during an update.

Back