Install Karabiner-Elements first.
Copy and paste one of the following URLs into your browser:
Default (CapsLock tap → CapsLock):
karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/Leftium/megakey/main/megakey.json
Esc variant (CapsLock tap → Esc):
karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/Leftium/megakey/main/megakey-esc.json
megakey.json or megakey-esc.json~/.config/karabiner/assets/complex_modifications/Choose one:
[!TIP]
Both versions support Fn+CapsLock to toggle Caps Lock on/off.