Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Now I have

setxkbmap -model acer_laptop -layout lang1,lang2 -variant ,
setxkbmap -option -option grp:caps_toggle

in a startup script. It works well for two languages.

I want to have 4 languages (like as in -layout lang1,lang2,lang3,lang4), hovewer I want Caps Lock to keep on switching between lang1 and lang2 and use some other method to loop thought all input languages.

How to do it? Can I call "setxkbmap" to only set current language (not affecting the Caps Lock cycle) so I can bind it to a keystroke?

share|improve this question
up vote 0 down vote accepted

Have bound the following script to a hotkey:

if setxkbmap -query | grep -q lang1,lang2 ; then 
    setxkbmap -model acer_laptop -layout lang3,lang4 -variant , ;
    setxkbmap -model acer_laptop -layout lang1,lang2 -variant , ;
share|improve this answer

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.