Ubuntu – How to remap CapsLock key to Ctrl in Xubuntu

autostartxubuntu

I'm trying to remap my CapsLock key to Ctrl key as described here (adding /usr/bin/setxkbmap -option "ctrl:nocaps" command to "Session and Startup"->"Application Autostart").

But this doesn't work in Xubuntu 12.04.

When I'm running the same command (/usr/bin/setxkbmap -option "ctrl:nocaps") from terminal everything works as expected. If I change command to: sh -c "/usr/bin/setxkbmap -option \"ctrl:nocaps\"" it again works if I'm running it from terminal, but it doesn't work if I add it to xfce "Session and Startup" configurator. Also when I create a script like this:

#!/bin/sh
/usr/bin/setxkbmap -option "ctrl:nocaps"

and add it to startup via "Session and startup" configurator, it has no effect at all. But if I run this script after login it actually remaps caps key as expected.

Best Answer

OK, my problem was because of xfce4-xkb-plugin. It was resetting xkb settings each time. I just installed xxkb instead of it, and now everything works absolutely fine!

Related Question