$ sudo vi /etc/default/keyboard
# remap CapsLock to Esc XKBOPTIONS="caps:escape"
$ sudo dpkg-reconfigure keyboard-configuration
xbindkeys -k