Summary

xmodmap is a utility for modifying keymaps(keyboard keys) and pointer button mappings in XOrg . details

Configurations

Change Caps lock to contorl

ref ~/.xmodmap

!capslock map to control

keycode 66 = Control_L
clear Lock
add Control = Control_L
keycode 117 = Caps_Lock
add Lock = Caps_Lock

! to set "setxkbmap -option"

! swap Caps_Lock and Control_R
!
remove Lock = Caps_Lock
remove Control = Control_R
keysym Control_R = Caps_Lock
keysym Caps_Lock = Control_R
add Lock = Caps_Lock
add Control = Control_R

then to apply this settings

Appying modfied

xmodmap ~/.xmodmap

Resetting the applied modifications

setxkbmap -option