Is there a way to change the currently active keyboard layout in Cinnamon, from command line?
The setxkbmap solution that most of the guides suggest, doesn't quite work as it is supposed to:
If it is called, the language indicator in Cinnamon itself dissapears, and the existing combinations configured in Cinnamon do not work any more. To restore this functionality, one has to go to the settings and re-enable any of the keyboard layout setting.
Additionally, the way setxkbmap seems to change the layout is of a nature of being lower level than Cinnamon seems to like: for example if you change a layout to a non-latin one, using setxkbmap, the default key combinations in the whole system stop working. (easily tested with Ctrl-C). This never happens with the native layout switching from within Cinnamon. It appears that setxkbmap operates at a lower level than what most applications expect.
Is there a way to change the layout the native, Cinnamon (or gnome, since it's based on it?) way and keep the keyboard combinations working?
(Another solution usually proposed is gsettings set org.gnome.desktop.input-sources current 0, which does not work either in current Cinnamon (nothing happens)).
I have of course, tested all the possible indexes, up to 10, even though I have only 3 layouts added currently. The mentioned variable does not seem to change either when the layouts are changed manually. I have also tried the similar variable that exists in Cinnamon environment, org.cinnamon.desktop.input-sources, but it does not affect anything either (in exactly the same way as the gnome version).
gsettings set org.gnome.desktop.input-sources current 1?