Remapping Caps Lock to Escape in Ubuntu 18.04 bionic

Found an option by installing Gnome Tweaks.

sudo apt install gnome-tweaks

Then open Tweaks, and click:

Keyboard & Mouse -> Additional Layout Options -> Caps Lock key behavior.

enter image description here

(On older versions of Ubuntu, you would need to install gnome-tweak-tool instead.)


In Ubuntu MATE 18.04, launch Keyboard and go to Layouts > Options > Caps Lock behaviour to customise Caps Lock (as an additional escape key, disable entirely, and other options).