Comment by avtar
> as far as I can tell, no operating system does this in a way that really works besides OSX
AFAIK this is an easy setting in desktop environments such as Cosmic, Gnome, and KDE. But I've been using keyd on Linux distros for a while:
https://github.com/rvaiya/keyd#quickstart
Using the config in the above example results in Caps Lock acting as Esc if used on its own or as Ctrl if it's held down.