FastNetMon

Friday 22 January 2021

How to switch keyboard layout in Ubuntu 20.04 LTS via Caps Lock?

 It's pretty easy, you need to create this folder:

sudo mkdir /etc/X11/xorg.conf.d

And then you need to create following file /etc/X11/xorg.conf.d/00-keyboard.conf with this content:

Section "InputClass"

        Identifier "system-keyboard"

        MatchIsKeyboard "on"

        Option "XkbLayout" "us,ru"

        Option "XkbModel" "pc104"

        Option "XkbOptions" "grp:caps_toggle"

EndSection

To apply changes you need to reboot your PC or laptop.  Tools like Tweak Gnome will not help because for some reasons in 20.04 Gnome resets configuration of custom keyboard layout when it set to Caps Lock.