How to set keyboard switch with Ctrl+1, Ctrl+2, Ctrl+3 etc
In windows in keyboard switch settings there is an option that you can switch keyboard language with unique combination for each one.
For example, Ctrl + 1 - for english, Ctrl + 2 - for russian, Ctrl + 3 for ukrainian etc. It would be super handy, if there is an option to set this thing in Ubuntu.
Are there any options?
You can do this using setxkbmap
. From man setxkbmap
:
The setxkbmap command maps the keyboard to use the layout determined by the options specified on the command line.
To do this, open Keyboard
from settings and click on Custom Shortcuts
. Click on the +
sign and add fill up the 'Custom Shortcut' windows as shown below:
Press Apply. Click on 'Disabled' and press Ctrl + 2 to make this as a shortcut for enabling Russian.
Now repeat the steps, but add setxkbmap us
as the command and Ctrl + 1 as the shortcut. This will enable Ctrl + 1 as the shortcut for English