Can I set up keyboard shortcuts for each input language? For example I want to set "Ctrl + 8" for English, "Ctrl + 9" for Ukrainian and "Ctrl + 0" for Russian languages. I don't want to switch and search language I need. It takes time. I want directly to turn language I want. I had this ability in Windows. Maybe I need to install some plugin?

up vote 9 down vote accepted

Go to System Settings - Keyboard - Shortcuts. Click on "Add" button.

(See here for how to create a custom shortcut: http://web.archive.org/web/20150705203244/http://bigknol.com/create-custom-keyboard-shortcuts-in-ubuntu-for-launching-chrome-firefox/)

enter image description here

For the name write,for example name of the input language - "English".

For the command write

gsettings set org.gnome.desktop.input-sources current 0

Here 0 indicates the number of the input language. (0 for the first one, 1 for the second one, etc.)

Then press on create a shortcut button and press the key combination you want.

Change the number according to the order of input languages. For example write

gsettings set org.gnome.desktop.input-sources current 1

for creating a shortcut for the second language.

As far as current is deprecated for org.gnome.desktop.input-sources in GNOME 3.2 so for Ubuntu 17.10, you can use one of the following commands:

  1. For the first language:

    gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyb0oard.getInputSourceManager().inputSources[0].activate()"
    
  2. For the second language:

    gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[1].activate()"
    
  • So this is applicable only for GNOME DE? What if I use XFCE? – Suncatcher Mar 9 at 12:27

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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