When I try to set the default combo for switching to different language layouts in my keyboard from Shift+Super+Space to Alt+Shift I can't.

I used to have this combo since Ubuntu 14 and even before that when I used to have Windows. Now for some stupid reason it does not allow (actually nothing happens its not like I get an error or the combo is used elsewhere). How could I bypass this bug?

  • 1
    Super+Space for switching input languages is the dumbest idea I have ever met on Ubuntu. In most of cases I end up with Search window over my workspace instead of other input language 😡 And even worth that Ctrl+Shift tweak breaks every shortcut in every application 👎
    – mevsme
    Jun 15 '21 at 8:02
  • yeah, thanks to Super+Space - lost a fast access to "tab" part of the keyboard so probably Alt+shift is the best, maybe Ctrl+Shift is fine also. Hey, we have a thumb finger which is quite flexible, however our little finger is really little. When someone proposes me to press the smallest key (Super) with the smallest finger (little finger) where there are different way better solutions, total insanity ))) So obviously little finger is ideally fit to shift keyboard which is the largest (so far in my three keyboards) and the other key should be either alt or space. Nov 11 '21 at 13:33

You may use (GNOME) Tweaks to achieve your goal. First install it by running

sudo apt install gnome-tweaks

(on Ubuntu 18.04 and later) or

sudo apt install gnome-tweak-tool

Launch Tweaks and go to Keyboard & Mouse section. Click on the "Additional Layout Options".

enter image description here

A new window should pop up. Look for "Switching to another layout" and expand it. Then check the "Alt+Shift" option.

enter image description here

  • 13
    What a mess.. and I am lucky since there are only hardcoded options and the one I want is in there.. :P I already miss unity ... Thanks m8! Also such a cute puppy! ^^
    – papajo
    Oct 22 '17 at 12:58
  • 5
    Also it is well known bug 1218322. Only gnome-tweak-tool solve this problem.
    – N0rbert
    Oct 22 '17 at 16:07
  • 1
    This does switch languages, but when I press Alt+Shift, Alt key press is handled by the active application. For example, it opens menu bar in Firefox. It makes switching languages very distracting every time. What am I doing wrong?
    – user502144
    Nov 20 '17 at 18:49
  • 1
    @user502144 You're not doing anything wrong, that's a GNOME issue, it triggers on-press instead of on-release. See this for a not-so-elegant workaround: askubuntu.com/a/973906/480481
    – pomsky
    Nov 20 '17 at 18:53
  • 3
    What I wanted was exactly the opposite - to free this key combination as it was messing up with my PHPStorm IDE's shortcuts, and the gnome tweak tool was the only way to do it (for me at least). This shortcut was enforced after an update which asked me if I wanted to enable this key combination... I don't remember clearly the type of the update. Even though I would like to have alt + shift for language switching, it does not behave exactly as the windows version and interferes with other short keys which use alt + shift, like for instance "alt + shift + up" in PHPStorm.
    – vivanov
    Aug 23 '18 at 19:35

You can achieve this using gsettings (command-line configuration tool).

  1. Set forward switch to Shift+Alt(left)

    gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Shift>Alt_L']"
  2. Set backward switch to Alt+Shift(left)

    gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Alt>Shift_L']"

To see the current setting value use get command:

gsettings get org.gnome.desktop.wm.keybindings switch-input-source
gsettings get org.gnome.desktop.wm.keybindings switch-input-source-backward

Examples of other key bindings:

<Primary>space, Alt_R, <Shift>Control_R, <Shift><Super>space

Changes will take effect immediately.

  • 12
    This is a nice way to achieve the desired change, but the instructions create a mapping that is unnatural for Windows users: you have to first press shift and then press Alt. To use the natural Windows sequence, change "['<Shift>Alt_L']" to "['<Alt>Shift_L']" and similarly for the backwards. Works just as it should. Apr 18 '18 at 9:55
  • This approach should be preferred over gnome-tweaks, because with gnome-tweaks there is one side effect where in certain apps (like slack) using alt+shift not only changes the language, but also looses you the focus from the app.
    – Todor
    Jan 27 '20 at 10:19
  • 3
    On ubuntu 19.10 this had the required effect, in contrary with gnome-tweaks which didn't seem to be working for alt+shift Feb 19 '20 at 7:35
  • 2
    Works in Ubuntu 20.04 LTS. The accepted answer with Gnome Tweaks has a bug when Shift+Shift change keyboard as well gitlab.gnome.org/GNOME/gnome-tweaks/-/issues/145
    – Arxeiss
    Jun 1 '20 at 9:00
  • 1
    @laughsalutesMonicaC On Windows, you can press either of the keys first. I'd actually like to see that on Ubuntu as well. Having used Windows for so long, I am used to pressing shift first since it's a bigger key on my keyboard and right next to my little finger.
    – undefined
    Jan 14 '21 at 8:34

Ubuntu 20.20, gnome flashback, the gsettings option didn't work for me. This fixed the problem (copied from my other machine):

gsettings set org.gnome.desktop.input-sources xkb-options "['grp:alt_shift_toggle', 'grp_led:scroll', 'lv3:switch']"

Keyboard shortcuts still show Super+Space combination, and it still works, but Alt+Shift works as well.

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