Linux – How to swap the caps lock to control in xfce

keyboardlinuxUbuntux11xubuntu

I used to have the caps lock and control swapped in GNOME, but when I upgraded to Ubuntu 9.04 I also changed my desktop environment to Xfce. I have the following line in my xorg.conf:

Option          "XkbOptions"    "ctrl:nocaps"

But that doesn't seem to make a difference to Xfce. Any ideas?

Best Answer

I ended up removing the "XkbOptions" line from my xorg.conf, and adding this to Xfce's autostart:

/usr/bin/setxkbmap -option "ctrl:nocaps" 

It turns the caps lock key into an additional Ctrl, which does the trick for me. If you wanted a straight swap, I believe "ctrl:swapcaps" would work. For what it's worth, this page is a fairly decent guide:

http://manicai.net/comp/swap-caps-ctrl.html

I haven't had a change to try the other methods yet, but I also have a netbook with a slightly funky layout, and I might need to muck around with it a bit.