I recently upgraded to Ubuntu 13.10. In Ubuntu 12.04, I was able to define a key which, while holding it, temporarily switched to a different keyboard layout. I haven't been able to find a way to get that functionality in 13.10: the only option seems to be to toggle between different layouts using the "Switch to next source" shortcut.

Is there a way to get the "hold a key to temporarily switch to a different keyboard layout" functionality in 13.10?

  • Was it the caps lock key? – Seth Feb 2 '14 at 2:05
  • @Seth: No, I defined the Windows key to temporarily switch the keyboard layout from English to German. – Jake Feb 2 '14 at 7:28
  • With Gnome 3.6, layout setting method changed. So Ubuntu 13.10 and later, has different behavior then before. This should work well in Gnome (Tested Ubuntu 13.10/14.04).

  • Unity seems not to use xkb-options (Tested it in Ubuntu 13.10/14.04). Even using for example:

    setxkbmap us,ara -option grp:rctrl_switch

    It just works for seconds, then it is reseted.

    Edit /usr/share/X11/xkb/symbols/pc, Remove rctrl from ctrl binding:

    //modifier_map Control{ Control_L, Control_R };
    modifier_map Control{ Control_L };


    setxkbmap us,ara -option grp:rctrl_switch

    It just works, till it I use change my layout using Super+Space or directly from indicator. So as workaround for Unity, Disable layout toggle shortcuts (layout indicator could removed too) then add a -option grp:..._toggle to setxkbmap .

So for Gnome:

  1. Use dconf-editor → org → gnome → desktop → input-sources

  2. Add setxkbmap options to xkb-options, example:


To see all possible options:

more /usr/share/X11/xkb/rules/xorg.lst | grep grp:

enter image description here

  • Are you sure this works? I tried it an it didn't (although I didn't do it exactly as you did) – Seth Feb 9 '14 at 19:30
  • Yeah, It works for me (Ubuntu 14.04). But I will check with fresh one, I have made too many experiments in this installation. So may be some previous tests setxkbmap or xbindkeys have some affects even after I reset my settings. – user.dz Feb 9 '14 at 19:45
  • I tried this on my system and couldn't get it to work, but maybe that's because I'm on 13.10. If it works on 14.04 that would be just as well, though. I'll upgrade soon and let you know. – Jake Feb 9 '14 at 19:47
  • Sorry, I didn't test unity thinking that both use same Gsettings. But it seems that only gnome care about xkb-options. – user.dz Feb 10 '14 at 0:07

Since asking the question, I've switched to Linux Mint 17 with the Cinnamon desktop. The Cinnamon desktop provides the same options for temporarily switching layouts that were available on Ubuntu 12.04, including the option to hold a particular key to temporarily switch keyboard layouts.

  • Ok but how did you do it on Cinnamon – Pavel Nov 13 '17 at 16:16

Please follow these steps:

  1. Select System Settings... from system menu; snap1

  2. Select Keyboard; snap2

  3. Under the tab labelled Typing click Layout Settings; snap3

  4. In the Keyboard settings window, under Shortcuts tab, select Typing. The default for Switch to next source is Super+SPACE; clicking on it will ask you to assign a New Accelerator..., press the desired key combination to change to next Layout (I used Super+L.) and it will be assigned to change to next layout.

    (Then I assigned something similar for Switch to previous source using the same preferred layout, and then began to test them. Switching from the preferred layout to the alternate worked but the reverse did not. Please refer the next step for the fix.) saucy1

  5. In the same window you can select/assign Compose key. The preferred one is Right Alt composeKey

  6. After assigning Super+L for "Switch to next source" using my preferred layout, I changed my keyboard layout to the alternative layout and then assigned the combination to "Switch to previous source" (for which I used Shift+Super+L). Then I tested them, and they work fine.

    The new accelerators for the key combos that I used looks like this: saucy2

Useful Links:

  • How can I enable Compose key?

  • How can I type accentuated characters like ë? alt. How to use compose keys?


    Using compose key, here assigned to Rt. Alt:

    • For ö you press Compose followed by Shify+' then o keys; putting the same other way it's Compose " o or Rt. Alt " o .
    • For ß you press Compose followed by s then s keys.

    (..here you'd have to remember the two character combination)

    You can get the combination for compose key (and Unicode number) with this command in terminal:

    cat /usr/share/X11/locale/en_US.UTF-8/Compose | grep ö

    (where ö should be replaced by the character of your choice.)

    which would output something like:

    <Multi_key> <quotedbl> <o>          : "ö"   odiaeresis

    (where <Multi_Key> is the Compose (Shift or Shift+Rt.Alt) key, <quotedbl> is the double quote - " i.e. Shift+' and <o> is the lowercase o i.e. o. For upper case Ö use O i.e. Shift+o and instead for the last character of compose combo.)

    Using hexadecimal Unicode character code point:

    • Press (and release) Shift+Ctrl+U, then, while underlined u is displayed, enter the hexadecimal Unicode character code point followed by Return or Space.

    e.g. Ctrl+Shift+u followed by 2 6 3 b and then Return or Space for ☻ .

    (..so this one would require you to remember the Unicode number)

☻ cheers...

  • I don't have those options. Is this screenshot taken on 13.10? – Jake Feb 8 '14 at 19:57
  • If I understand correctly, the 13.10 option only allows to switch between layouts, but not to temporarily activate a different layout while some key is pressed. I frequently only need a single letter from the second letter, so switching to that layout, typing the letter, then switching back is quite a hassle. – Jake Feb 9 '14 at 8:04
  • @Downvoter would you mind to justify the -1 ?!? pa-leease!! – precise Feb 9 '14 at 19:39
  • No, the compose key is for accessing special keys on certain layouts (like é). I didn't downvote the answer, but I can imagine that someone downvoted because it doesn't answer the question (the first part is about pre-13.10, even though the question explicitly mentions 13.10, and the second part is about switching layouts, not temporarily activating one while holding a key). Thanks for your efforts, though! – Jake Feb 9 '14 at 19:45
  • 1
    Yes, exactly. I was just very happy with the solution that was available, and very sad to find that it doesn't seem to work with 13.10. – Jake Feb 9 '14 at 21:00

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.