Setting up keyboard maps on GNU/Linux

Xorg

introduction

Here´s a choice for a few US International keymaps

altgr-intl  English (intl., with AltGr dead keys)
alt-intl    English (US, alt. intl.)
intl        English (US, intl., with dead keys)

The standard one is just intl, you got dead keys all around (need to type ´ then e to get é. It’s painful and slows you down when you don’t need internationalized keyboard, as you need to type ' followed by space just to get the tilde.

The alt-intl alternative is simply adding a few more dead-keys to it. See /usr/share/X11/xkb/symbols/us for more details.

The right choice as far as I am concerned seems to be altgr-intl so far. You don’t have dead-keys there. You have AlgGr all the way.

It is worth mentioning the GB (UK) International flavor intl which behaves just like the US one. There are dead-keys.

It may be worth having a look at CA fr variant also. That´s a QWERTY with french accents and no dead-keys. However it s a very different kind of QWERTY… And it has the same disadvantage as the French one: it’s a specific layout and brackets are hard to reach.

setup

Configure keymaps

dpkg-reconfigure keyboard-configuration
--> 101-keys (we do not use the windows key)
--> English (US)
--> US intl., with AltGr dead keys
--> default (AltGr)
--> no compose key
--> control-alt-backspace OK

dpkg-reconfigure locales
--> en_US.UTF-8

and here is THE TRICK to toggle language (XKBOPTIONS)

vi /etc/default/keyboard

XKBMODEL="pc101"
XKBLAYOUT="us,ru"
XKBVARIANT="altgr-intl"
XKBOPTIONS="terminate:ctrl_alt_bksp,grp:alt_space_toggle"

BACKSPACE="guess"

as user

Thanks to dottedmag on freenode#xorg this is the right syntax, according to evdev rules. Layout and variant needs the same number of arguments: note the additional comma after altgr-intl when specifying two layouts.

# setxkbmap -layout us -variant altgr-intl -option terminate:ctrl_alt_bksp,grp:alt_space_toggle
setxkbmap -layout us,ru -variant altgr-intl, -option terminate:ctrl_alt_bksp,grp:alt_space_toggle
setxkbmap -query
setxkbmap -query -verbose 10
setxkbmap -print
xmodmap
xset q

acceptance for altgr-intl

this is what we have altogether with altgr

¹²³¤€’¥×
äåéëþüúíóö«»¬
áßðfghïœø¶
ǽœ©®bñµç

with shift+altgr

¡½¾
ÄÅÉËÞÜÚÍÓÖ“”¦
Á§ÐFGHόذ
Œ¢®BѵÇ

and this is what we need for French language

é  altgr + e

à  altgr + ` then a
è       altgr + ` then e
ú       altgr + ` then u

â  altgr + ^ then a
(same for ê, î, ô, û)

ç  altgr + ,

acceptance for altgr-weur

altgr-weur

¹²³£€šž‘’ß×
åäéèøùúíóò«»
áàëêûìüïöô
ấæçãîñõ¿

this is what we need for French language

é  altgr + e

à  altgr + s
è  altgr + r
ú  altgr + u

â  altgr + ^ then a
(same for ê, î, ô, û)

ç  altgr + c

«  altgr + [
»  altgr + [

Additional notes

ls -lF /usr/share/X11/locale/en_US.UTF-8/Compose
grep dead_acute /usr/share/X11/locale/en_US.UTF-8/Compose

ls -lF /usr/share/X11/xkb/symbols/us
grep -dskip xkb_symbols.*intl /usr/share/X11/xkb/symbols/*

unused

# gsettings get org.gnome.desktop.input-sources xkb-options
# udevadm trigger --subsystem-match=input --action=change

unfortunately it seems we cannot fully visualize internationalized keymaps with xkbprint

setxkbmap -print -model pc101 -layout us -variant altgr-intl > us.keymap
xkbcomp us.keymap
ls -lF us.xkm
xkbprint -label symbols us.xkm - | ps2pdf - > us.pdf

Resources

https://en.wikipedia.org/wiki/Keyboard_layout

https://en.wikipedia.org/wiki/QWERTY

physical layout

https://en.wikipedia.org/wiki/IBM_PC_keyboard#Keyboard_layouts

https://en.wikipedia.org/wiki/Keyboard_layout#Physical,_visual,_and_functional_layouts

dwm

https://unix.stackexchange.com/questions/599191/how-to-add-keyboard-layout-in-dwm

https://www.reddit.com/r/suckless/comments/ifo3jr/assign_a_keybind_to_change_keyboard_layout_dwm/

https://bbs.archlinux.org/viewtopic.php?id=254804

us intl

https://dry.sailingissues.com/us-international-keyboard-layout.html

https://askubuntu.com/questions/461748/how-do-i-change-keyboard-geometry-from-104-to-105-keys

https://unix.stackexchange.com/questions/7493/why-is-the-us-international-keyboard-layout-on-debian-different

https://askubuntu.com/questions/703211/us-intl-keyboard-layout-without-dead-keys

https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config/-/issues/233

https://github.com/NixOS/nixpkgs/issues/15923

https://github.com/mike-fabian/langtable/issues/9

https://cgit.freedesktop.org/xkeyboard-config/tree/symbols/us

custom dvorak https://gist.github.com/mew/f5efa16402d7035f8308e77f11b194e6

apparently Arch Linux has another kind of US alternative international layout https://www.quora.com/What-is-the-difference-between-the-keyboard-layouts-US-alternative-international-and-US-international-with-dead-keys

us altgr-intl

https://zuttobenkyou.wordpress.com/2011/08/24/xorg-using-the-us-international-altgr-intl-variant-keyboard-layout/

https://blechtog.wordpress.com/2012/05/24/52/

https://lists.x.org/archives/xorg/2007-July/026534.html

https://www.choam.eu/altgr-intl/

https://github.com/google/us-altgr-intl

xorg

https://www.x.org/releases/X11R7.5/doc/input/XKB-Config.html

https://askubuntu.com/questions/1201655/set-xkb-options-in-my-keyboard-layout

https://askubuntu.com/questions/950020/setting-multiple-options-in-etc-default-keyboard

https://unix.stackexchange.com/questions/406688/what-is-the-difference-between-base-and-evdev-xkb-rules

windows

https://www.scottseverance.us/html/keyboard/win_intl_altgr/

https://superuser.com/questions/1369470/alternative-us-intl-keyboard-layout-which-is-not-clever-with-the-quotes https://keyboards.jargon-file.org/ https://chris.charabaruk.com/2014/10/alternate-us-international-keyboard-layout/ https://github.com/thomasfaingnaert/win-us-intl-altgr

tweaks

https://askubuntu.com/questions/1187917/change-accented-letters-in-international-with-dead-keys-keyboard-layout

tools

https://www.lepointdufle.net/ressources_fle/lettres_accentuees.htm

visualize

https://askubuntu.com/questions/380052/how-to-use-xkbprint https://unix.stackexchange.com/questions/348021/visualizing-layout-key-maps-in-xkb


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun