This is a custom keyboard layout for macOS. On Linux distributions, Chrome OS and Windows it is typically called US International with dead keys.
I modified some illustrative ASCII art I found, which you can find here.
- TODO: describe GUI
- TODO: describe terminal
curl -L https://raw.githubusercontent.com/lwbt/osx-us-altgr-intl/master/install.sh | bash
To my current knowledge you have to reboot or log out of your Mac and back in again to be able to use it. I think there must be a system service in macOS which you can trigger to pickup tha changes.