1

I use many languages, right now 7 and I don't like to use only one shortcut to move among them in a cyclic way. Because I am simply not using them in a cyclic order :) In Windows, one can assign a specific shortcut for each separately. For example Ctrl+1 for Persian, Ctrl+2 for English, ..., Ctrl+6 for Thai etc. Therfore at any time no matter what language my keyboard is at the moment, I just need to press one shortcut to move to the language that I want (not repeating the shortcut until arriving to the desired language). And I type in several languages in the same text very often, so it is not matter of just using one language at a time. I have moved my old computer from Windows 10 to Linux Mint 20.1 with Cinnamon and I'm kind of insisting to remain on this combination. Now the question is how can I have my Ctrl+number here in Mint+Cinnamon?

All searches took me to only how to assign the cyclic layout changing shortcut. Therefore I'm asking this question here ^_^

1

One possible solution would be mapping a key shortcut to setxkbmap for each layout. Here is a tutorial on how to set custom shortcuts in Linux Mint. Then you set each shortcut accordingly.

example of custom shortcut

# a few command examples
setxkbmap us              -option 
setxkbmap de -variant neo -option
setxkbmap de -variant neo -option caps:swapescape

See man setxkbmap for more details.

notes:

  • if you use an -option for at least one but not all layouts, you might need to pass an empty -option argument so that it reverts to the default options.

  • This solution has a drawback that the Desktop Environment might not really be aware of the changes applied via setxkbmap, so it can be that after returning from suspend the keyboard layout gets changed back to the default one. But I am not aware of another way of changing the layout from the command line that the DE would be notified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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