xorg.conf
When AutoAddDevices
is enabled, the classic
InputDevice
section with kbd
driver no longer
works. In order to set the layout in the config file, this kind of stanza is
used:
Section "InputClass" Identifier "All keyboards" Option "XkbModel" "pc105" Option "XkbLayout" "fr" Option "XkbVariant" "basic" Option "XkbOptions" "altwin:left_meta_win,compose:menu" EndSection
The list of options can be found in
/usr/share/X11/xkb/rules/base.lst
. They usually have the
structure
function-to-map:actual-key-to-use
. For
example, compose:menu
means to use the key with the “menu”
pictogram (just on the left of the right control key) for the “compose”
(Multi_key
) function.
xkbcomp -xkm $input_options $DISPLAY - | xkbprint -eps -color $print_and_layer_options - - | convert -density 144 eps:- -background white -flatten -alpha off x:
The $input_options
select exactly where
xkbcomp
goes to fetch the layout and geometry. The
$print_and_layer_options
are typesetting options
(for example: use pictograms instead of names) and select what part of the
layout to print (for example: show with “AltGr” pressed).
Section "InputClass" Identifier "Test USB keyboard" MatchUSBID "0e6a:6001" Option "XkbLayout" "us" other options EndSection
The InputClass
section is documented in
xorg.conf(5)
.
First, find the identifier of the different keyboards:
$ xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech USB-PS/2 Optical Mouse id=9 [slave pointer (2)] ⎜ ↳ USBPS2 id=11 [slave pointer (2)] ⎜ ↳ MCE IR Keyboard/Mouse (ite-cir) id=12 [slave pointer (2)] ⎜ ↳ HID Keyboard Device id=19 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ USBPS2 id=10 [slave keyboard (3)] ↳ ITE8713 CIR transceiver id=13 [slave keyboard (3)] ↳ HID Keyboard Device id=14 [slave keyboard (3)]
Then load a description file to the selected device:
xkbcomp -w 3 -i 14 layout2.xkb $DISPLAY
Note: setxkbmap -device
does not seem to work. On the other
hand, setxkbmap -print
can be used to generate the description
file.
setxkbmap -print -option -layout fr | xkbcomp -w 3 -i 14 - $DISPLAY