Use Alt-Shift for keyboard layout switching in GNOME 40

Since GNOME 40 the keyboard layout indicator doesn’t work if the keyboard is switched using a key combination defined in GNOME Tweaks. The indicator does work for key combinations defined through GNOME Setting’s Keyboard Shortcut settings. However, GNOME Settings doesn’t allow one to set Alt+Shift as the key combination layout switching, as it seems to require at least one non-modifier key in every shortcut. This limitation only exists in GNOME Settings GUI and you can work around it by defining the shortcut using gsettings:

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

5 thoughts on “Use Alt-Shift for keyboard layout switching in GNOME 40”

  1. Thank you very much! I originally achieved the same through Tweaks, but language indicator in Ubuntu 24 was out of synch and I started having issues entering the password, as I didn’t know which language was on at any given time. Your solution here solved my problem. Thank you for taking time to write it up and post!

Leave a Reply

Your email address will not be published. Required fields are marked *