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

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

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

Some more explanation: Two methods for a test-run. But: please check if the Western European layout is (already) available in the GUI keyboard configuration tools (gnome-control-center, at the very bottom of this page) before you unnecessarily start modifying files. As of May 2022, this layout is included in Debian (unstable); expect to be able to select the layout from a GUI on mayor distros within a year.

Try altgr-weur just this session, for the current user

Make two directories (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.)

You could do all of the above in one move:

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

That last command will download a small script ('program') with the manual procedure above 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).

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

Use 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 below.

Use 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.)

Back