Windows

Use PowerToys Keyboard Manager

Linux

setxkbmap -option caps:escape

This will only make the change temporarily. It can be added to ~/.profile to make permanent.

Another way is to use dconf-editor:

  • select org.gnome.desktop.input-sources
  • Change xkb-options to ['caps:escape']