Quick and easy (if you are using HomeBrew): copy and paste the line below into a terminal:
If you are not using HomeBrew, try the method below. The information below was taken from Tiago's github page, where a possibly more recent version is available.
Copy two files altgr-weur.keylayout
(local alternative; github alternative; github permalink) and altgr-weur.icns
to ~/Library/Keyboard Layouts
.
Copy two files altgr-weur.keylayout
and altgr-weur.icns
to system-wide /Library/Keyboard Layouts
.
A system-wide installation is preferred though to ensure the layout is available to all applications. (See also this Superuser answer.)
Open your keyboard preferences in System Preferences > Keyboard > Input Sources
and click
the +
button on the bottom left side and select AltGr WEur under Others:
The macOS version of AltGr-WEur is kindly provided by Tiago Sousa.