From https://askubuntu.com/questions/363346/how-to-permanently-switch-caps-lock-and-esc First make sure the dconf-editor is installed
# add this to the comma seperated string field xkb-options inside dconf
# to swap caps=lock with escape keys
'caps:swapescape'