Since my laptop is often (dis)connected from the dock to which an Apple Keyboard is attached, I am looking for a convenient way to trigger some changes in keyboard layout through from the command line / script.
The effect I want to achieve is the same as going to System Settings -> Keyboard Layout -> Options ... and tick the "Left Alt is swapped with Left Win" under "Alt/Win key behavior".
After performing the above GUI operation, I can see that the command
Produces the following output:
gconftool-2 --get /desktop/gnome/peripherals/keyboard/kbd/options
But, I want to achieve the same effect of via the command line instead. Therefore, I tried the following:
which should effectively achieve the same effect as above (and indeed running the above get command confirms this).
gconftool-2 --set --type=list --list-type=string /desktop/gnome/peripherals/keyboard/kbd/options "[altwin altwin:swap_lalt_lwin]"
However, for some weird reason changes don't take effect (the key bindings are still unaffected), even though they are visible via both gconf-editor or gconftool-2.
Moreover, when I go to the GUI the changes are not visible and if I am to make the change now the GUI crashes.
Any ideas why it does not work?