Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

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:

share|improve this answer
It does not actually work for me. It only seemed to work. Follow up:… – Honza Javorek Sep 5 '12 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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