Setting the x keymap directly using the command line is by far my preferred way of dealing with keymaps, and it's very disto-agnostic, so any solution you come up with will stand you in good stead.
Try this:
setxkbmap -print | xkbcomp -xkb -o original.xkb -
this will make a backup of your original keymap. Then do
cp original.xkb switch-CAPS-LCTL.xkb
Now edit switch-CAPS-LCTL and find the lines that read
<CAPS> = ??;
<LCTL> = ??;
where ?? is a number. On mine, these are two digit numbers, 66 and 37 respectively. Just switch them around and you're done.
xkbcomp switch-CAPS-LCTL.xkb $DISPLAY
switches the layout, and
xkbcomp original.xkb $DISPLAY
will restore the old configuration.
If you are going to be using these two keymaps concurrently, for maximum user-friendliness, just make two aliases to handle these keymap changes, and plop the keymaps into a hidden directory like ~/.stuff
mkdir ~/.stuff
mv original.xkb switch-CAPS-LCTL.xkb ~/.stuff
nano ~/.bashrc
Add the following to ~/.bashrc:
alias capswitch="xkbcomp ~/.stuff/switch-CAPS-LCTL.xkb $DISPLAY"
alias ctrlswitch="xkbcomp ~/.stuff/original.xkb $DISPLAY"
then,
source ~/.bashrc
if you want the changes to take effect immediately, typing capswitch and ctrlswitch to change the keymap.
Savebutton in Gnome. After you change the setting, it should become effective immediately. – Mikel Apr 21 '12 at 23:00WFMmeaning Works For Me. So I don't understand why it's not working for you. Need more details. Are you using multiple locales? Is there anything non-standard about your setup? – Mikel Apr 22 '12 at 1:34