Low Orbit Flux Logo 2 F

Arch Linux How to Change Keyboard Layout

The default keyboard layout is US. If you want to change the keyboard layout on Arch Linux you can do this:

ls /usr/share/kbd/keymaps/*/.map.gz show keymaps (console )
loadkeys de-latin1 set keymap for current session only (console)
echo KEYMAP=uk >> /etc/vconsole.conf set keymap persistently (console)
setxkbmap -print -verbose 10 show XKB settings
setxkbmap -model pc104 -layout cz,us -variant ,dvorak -option grp:alt_shift_toggle set keymap for current session only (xorg)
localectl –no-convert set-x11-keymap cz,us pc104 ,dvorak grp:alt_shift_toggle set keymap persistently (xorg)

More Details ( console )

Keymaps are kept here: /usr/share/kbd/keymaps/

You can view them like this:

ls /usr/share/kbd/keymaps/**/*.map.gz

Or use find:

find /usr/share/kbd/keymaps/ -type f

You can temporarily load a new keymap like this ( only for current session ):

loadkeys de-latin1

Localectl

There is another tool called localectl. It is included with systemd.

This will show what keyboard configuration you currently have:

localectl status

You can list the keymaps like this:

localectl list-keymaps

Or search like this:

localectl list-keymaps | grep -i latin

Persistent keymap for Arch Linux ( console )

If you want your keymap setting to survive boot, define it in your vconsole.conf file. Systemd will read this. US will be default if it is not defined.

/etc/vconsole.conf
KEYMAP=uk

You can also use localectl to set the keymap persistently and for the current session:

localectl set-keymap --no-convert keymap

XOrg Keyboard Layout Change on Arch Linux

You can show XKB settings like this:

setxkbmap -print -verbose 10

You can change the layout for the current X session like this:

setxkbmap -model pc104 -layout cz,us -variant ,dvorak -option grp:alt_shift_toggle

To make this change persistent you can place it in either xprofile or xinitrc. This will override other X settings.

You can add a section like this to your xorg keyboard config:

/etc/X11/xorg.conf.d/00-keyboard.conf
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "cz,us"
        Option "XkbModel" "pc104"
        Option "XkbVariant" ",dvorak"
        Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

You can also set the XOrg keyboard layout using localectl like this:

localectl --no-convert set-x11-keymap cz,us pc104 ,dvorak grp:alt_shift_toggle

This will overwrite /etc/X11/xorg.conf.d/00-keyboard.conf and cause it to be overwritten on every boot. You won’t want to edit it manually because systemd will just overwrite it on boot.

More About How to Change Keyboard Layout on Arch Linux

A lot more can be done including creating custom keymaps. You can learn more from the Arch Linux wiki. See the links at the bottom of the page in the references section. Hopefully this has at least given you a start or potenially solved any issues you had. The Arch wiki has practically endless information and far more detail than what you will find here.

References