Ubuntu 17.10 and later: can't change the input switching shortcut to alt+shift
Solution 1
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".
A new window should pop up. Look for "Switching to another layout" and expand it. Then check the "Alt+Shift" option.
Solution 2
You can achieve this using gsettings
(command-line configuration tool).
-
Set forward switch to Shift+Alt(left)
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Shift>Alt_L']"
-
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.
Solution 3
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.
Related videos on Youtube
papajo
Updated on September 18, 2022Comments
-
papajo over 1 year
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?
-
mevsme almost 3 yearsSuper+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 👎
-
Nusrat Nuriyev over 2 yearsyeah, 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.
-
-
papajo over 6 yearsWhat 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! ^^
-
N0rbert over 6 yearsAlso it is well known bug 1218322. Only gnome-tweak-tool solve this problem.
-
pomsky over 6 years@N0rbert Are you sure Tweaks is the only way? Not possible with
dconf
/gsettings
? -
N0rbert over 6 yearsBy 'only' I mean GUI for average and newbie users. Setting it from
dconf
/gsettings
may be possible too. -
user502144 over 6 yearsThis 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?
-
pomsky over 6 years@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
-
voithos over 6 yearsWhat about switching to the previous input source? Is that possible to set as, say, "Ctrl + Alt + Shift"? Having to cycle through them all becomes a bit annoying with 3 or more sources.
-
Ivan Klass over 6 yearsThank you very much - that helped me to disable Alt-Shift (it broke other application hotkeys)
-
Tony Bogdanov over 6 yearsHey, what theme is this, it looks awesome?
-
pomsky over 6 years@TonyBogdanov It's a modified Arc theme, but I forgot from where I got it.
-
laugh salutes Monica C about 6 yearsThis 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. -
vivanov almost 6 yearsWhat 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.
-
yuranos over 5 yearsWhen I do it via Tweaks, it is not persisted. The setting disappears after a reboot.
-
pomsky over 5 years@yuranos87 Sorry, cannot reproduce! :( Works fine here even on 18.04. Did you launch Tweaks as root (or in a root session) by any chance?
-
Vlad over 5 yearswow i love this tool
-
Yazon2006 almost 5 yearsWarning! This tweak lead to bug in JetBrains IDEs. When you press Alt+Shift+Something it will work only like Alt+Shift. It triggers on-press instead of on-release.
-
Mohammad Heydari almost 5 yearsWorks fine on 18.04 LTS
-
Jan Mares over 4 yearsThis leads to another bug on Debian - L. Shift + R. Shift then also changes the layout - very annoying and difficult to fix.
-
Todor over 4 yearsThis approach should be preferred over
gnome-tweaks
, because withgnome-tweaks
there is one side effect where in certain apps (likeslack
) usingalt+shift
not only changes the language, but also looses you the focus from the app. -
today over 4 yearsUsing this method, I could switch the input languages back and forth by pressing "Left Alt+Left Shift" repeatedly; however, pressing "Right Alt+Right Shift" works only one time and pressing it again does not work (i.e. it does not switch back to the previous language). And the problem is I am used to the right combination for switching languages.
-
Jonathan La'Fey over 4 yearsOn ubuntu 19.10 this had the required effect, in contrary with gnome-tweaks which didn't seem to be working for
alt+shift
-
bluepearlsky about 4 yearsBrilliant way to achieve this. Worked instantly on Ubunu 18.04.3 LTS with Unity desktop.
-
Eugene about 4 yearsit doesnt work on my side. i have unchecked the ckeckbox as on the screen above and run in the terminal these two gsettings commands, but when i click alt+shift or shift+alt nothing happens and layout not changed... how to force this gsettings to work ?
-
Arxeiss almost 4 yearsWorks 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
-
y.bregey almost 4 yearsthe only one that worked for me on Ubuntu 18.04.4. thanks!
-
y.bregey almost 4 yearsgnome tweaks worked for me only with some other combinations but alt+shift on Ubuntu 18.04.4.
-
undefined over 3 yearsSelecting
Alt+Shift
will not work if you press Shift first. And there is no optionShift+Alt
in the settings. That's a bit of a bummer -
undefined over 3 years@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.
-
rustyx about 3 yearsNote that this setting completely hogs up Alt-Shift, making it impossible to use in e.g. Alt-Shift-Tab. See bug #36812.
-
rubmz over 2 yearsStill cannot anwer with my low credits but it's: gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Alt>Shift_L', '<Alt>Shift_R', '<Shift>Alt_L', '<Shift>Alt_R']"