I use Xubuntu. As everyone knows, Keyboard Layouts Plugin is very, very buggy and it still forgets my settings. It drives me crazy - I have to set them again and again every time I wake up or turn on my laptop.

So I found a solution - put into my .bashrc this:

setxkbmap -option '' -option grp:alt_shift_toggle cz,us -variant querty

That should set my toggle to Alt+shift and my layouts to Czech QUERTY and plain US English as a second one. Voilà, that seems to work! I could use Keyboard Layouts Plugin only as an indicator, that's okay.

However, it doesn't work well. The problem is that it ignores -variant setting. More or less. In Keyboard Layouts Plugin I actually see Czech QUERTY selected, but in reality my keyboard types QUERTZ. That's insane :-(

Could anyone help, please?


Well, the right answer is: There is a typo. It's not Q U ERTY, but Q W ERTY! I promise next time I'll ask at the morning, being fresh.

However, until I realized it's typo, I searched and experimented even more and I came up with a different, less hackish solution:

I found out there is a /etc/default/keyboard file with keyboard settings. If I edit it and then dare to touch Keyboard Layouts Plugin, my changes are preserved even after multiple restarts. No need for any hacks with setxkbmap.

I edited the file in a following way:

# Check /usr/share/doc/keyboard-configuration/README.Debian for
# documentation on what to do after having modified this file.

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.


# If you don't want to use the XKB layout on the console, you can
# specify an alternative keymap.  Make sure it will be accessible
# before /usr is mounted.
# KMAP=/etc/console-setup/defkeymap.kmap.gz

This works. Hope it helps someone!

See also:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.