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?


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

| improve this answer | |
  • 11
    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
  • 3
    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.

| improve this answer | |
  • 11
    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. – laugh salutes Monica C Apr 18 '18 at 9:55
  • 1
    Works in Ubuntu 19.10, thanks! – yrnkrn Dec 23 '19 at 18:50
  • 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 at 10:19
  • 2
    On ubuntu 19.10 this had the required effect, in contrary with gnome-tweaks which didn't seem to be working for alt+shift – Jonathan La'Fey Feb 19 at 7:35
  • Brilliant way to achieve this. Worked instantly on Ubunu 18.04.3 LTS with Unity desktop. – bluepearlsky Apr 2 at 10:30

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.

| improve this answer | |

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