Changing default system keyboard layout in Linux

This post will outline the steps to change default System keyboard layout which is used to control the layout used on the terminal and UI on Linux operating system.

Check current locale

The command to check locale and current keyboard layout is as given below

$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: us
X11 Model: pc105+inet
X11 Options: terminate:ctrl_alt_bksp

VC Keymap refer to console keyboard mapping and X11 refer to GUI keyboard mapping.

Check available keymaps

Use following command to check all available keymaps

$ localectl list-keymaps 

Find Japanese keyboard layouts

Use following command to check Japanese keyboard layouts

$ localectl list-keymaps | grep jp
jp
jp-OADG109A
jp-dvorak
jp-kana86
jp106

How to change Keymap (keyboard layout)

Use following command to change default keyboard layout for virtual console

$ localectl set-keymap <Keymap name>

e.g. if we want to change to Japanese use the command

$ localectl set-keymap jp

After running this command check the status as below

$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: jp
X11 Layout: us

To change X11 keyboard layout use the following command

$ localectl set-x11-keymap jp

$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: jp
X11 Layout: jp

To have different layout on X11 and virtual console use the –no-convert option

$ localectl --no-convert set-x11-keymap us
$ localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: jp
X11 Layout: us

0 Comments on Changing default system keyboard layout in Linux

Leave a Comment

Your email address will not be published. Required fields are marked *

You Might Be Interested In