setxkbmap resets in ubuntu 13.10
Gnome
Gnome preserve xkb options.
Use
dconf-editor
→ Follow path/org/gnome/desktop/input-sources
-
Put layouts needed in
sources
, example:[('xkb','us'),('xkb','ara')]
-
Add
setxkbmap
options toxkb-options
, example:['grp:rshift_toggle', 'grp:rctrl_switch']
Unity & Gnome
xkb setting seems to be reset by Unity/Gnome settings daemon (periodically or when clicked to change layout) or when layout switch shortcuts used.
The above the method may not work. So this should disable completely the settings daemon layout control capability. Tested on Ubuntu Unity 15.10 .
-
Rename the keyboard plugin of settings daemon to disable it.
sudo mv /usr/lib/unity-settings-daemon-1.0/libkeyboard.so /usr/lib/unity-settings-daemon-1.0/libkeyboard.so.disabled
-
Restart the settings daemon
restart unity-settings-daemon
Note:
- Ubuntu <= 13.10, Gnome & Unity uses same daemon (
gnome-settings-daemon
). - Ubuntu >=14.10, Gnome has
gnome-settings-daemon
& Unity hasunity-settings-daemon