As some people might know, you can easily switch Caps lock with the Left Ctrl key, by adding Option "XkbOptions" "ctrl:swapcaps" to the Keyboard InputDevice section in /etc/X11/xorg.conf

However, to have caps lock switch with the right control key, don’t bother Googling, you probably won’t find anything (At least, I didn’t…). Of course, some will say that having two Ctrl keys on the same hand isn’t as ergonomic as one per hand, but I never use the right Ctrl key compared to the left one. To switch Caps Lock with the right control key, you’ll need to modify /etc/X11/xkb/symbols/ctrl .

In /etc/X11/xkb/sybols/ctrl , replace the following:

// swap the caps lock key with the left control key
partial modifier_keys
xkb_symbols "swapcaps" {
    key <CAPS>  {  symbols[Group1]= [ Control_L ] };
    key <LCTL>  {  symbols[Group1]= [ Caps_Lock ] };
};

with this:

// swap the caps lock key with the right control key
partial modifier_keys
xkb_symbols "swapcaps" {
    key <CAPS>  {  symbols[Group1]= [ Control_R ] };
    key <RCTL>  {  symbols[Group1]= [ Caps_Lock ] };
};

I had tried copying it over, and creating one called ‘rightswapcaps’, but, it didn’t work :( Add the ‘ctrl:swapkeys’ line to /etc/X11/xorg.conf, so that it looks somewhat similar to the following, and you’re off to the races:

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc104"
        Option          "XkbLayout"     "dvorak"
        Option          "XkbOptions"    "ctrl:swapcaps"
EndSection

Note & Disclaimer: You’ll have to restart X for the changes to take effect. I am not responsible for any damages that might result from having followed this guide, but I will try to solve any problems this guide might cause.