In Ubuntu 16.04 I have 2 input methods (keyboard layouts) configured, CZ (default) and US. Also I have enabled different input methods for different windows. This configuration works as expected and so far I like it, but I would like to modify its behavior in one special case.
I would like to set the initial layout of a terminal window (GNOME Terminal) to US. The problem is that now, when I open the terminal window, a default language or the language of the previous window (according to the configuration) is used, which is not US every time.
I tried to add setxkbmap -layout us
to ~/.bashrc
, it changed the layout, but the layout indicator (in the top right corner) did not change and when the terminal window lost and regained focus, the modification done by setxkbmap
was no longer applied. It seems to me that the daemon which takes care of managing per-window layouts didn't register the modificatin by setxkbmap
. A command which tells the daemon to use a given layout for the actual window would probably solve my problem.
gsettings set org.gnome.desktop.input-sources current 0
instead (or possibly the number needs to be1
, depending on how you have ordered your layouts). – Gunnar Hjalmarsson Mar 12 '17 at 13:02gsettings set org.gnome.desktop.input-sources current 1
works for me. Ideally I'd like to specify US directly, but it is not necessary. @GunnarHjalmarsson if you create an answer, I'll accept it. – bedrorom Mar 12 '17 at 16:33~/.bashrc
is sufficient. I'm not sure that solution fits at the other question. – Gunnar Hjalmarsson Mar 12 '17 at 20:07