Display multiple keyboard layouts on the login screen

You can change the system keyboard layout settings to add alternative keyboard layouts for users to choose from on the login screen. This can be helpful for users who normally use different keyboard layouts from the default and who want to have those keyboard layouts available at the login screen.

Change the system keyboard layout settings

  1. Find the codes of the desired language layouts in the /usr/share/X11/xkb/rules/base.lst file under the section named ! layout.

  2. Use the localectl tool to change the system keyboard layout settings as follows:

    localectl set-x11-keymap layout

    You can specify multiple layouts as a comma-separated list. For example, to set es as the default layout, and us as the secondary layout, run the following command:

    $ localectl set-x11-keymap es,us
  3. Log out to find that the defined layouts are available at the top bar on the login screen.

Note that you can also use the localectl tool to specify the machine-wide default keyboard model, variant, and options. See the localectl(1) man page for more information.

Display multiple keyboard layouts without using localectl

On systems that do not provide the localectl tool, you can change the system keyboard layout settings by editing a configuration file in /usr/share/X11/xorg.conf.d/.

Change the system keyboard layout settings

  1. Find the codes of the desired language layouts in the /usr/share/X11/xkb/rules/base.lst file under the section named ! layout.

  2. Add the layout codes to /usr/share/X11/xorg.conf.d/10-evdev.conf in the following way:

    Section "InputClass"
      Identifier "evdev keyboard catchall"
      MatchIsKeyboard "on"
      MatchDevicePath "/dev/input/event*"
      Driver "evdev"
      Option "XkbLayout" "en,fr"
    EndSection

    Multiple layouts can be added as a comma separated list, as shown in the example for English (en) and French (fr) layouts.

  3. Log out to find that the defined layouts are available at the top bar on the login screen.