Switching keyboard layout in X on Linux

Finally I decided to reserve time to figure out how to switch keyboard layout to be able to write language specific characters.

As usually the Arch Wiki was very resourceful and helpful https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

Just run the following in terminal and it worked with Alt+Shift

mike@localhost$ setxkbmap -model pc104 -layout us,sk -variant ,qwerty -option grp:alt_shift_toggle

I then added the configuration into Xorg servers config to avoid issuing the command after restart.

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

Author: Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s