Generate Wayland client bindings for the Odin programming language.
- Wayland Protocols: XML files (e.g
/usr/share/wayland/wayland.xml,/usr/share/wayland-protocols/*.xml). - pkg-config (optional): Used by the generate script to detect the Wayland and Wayland protocols directories.
./generate.shThis will:
- Build the scanner (default:
wayland-scanner). - Generate the core Wayland protocol in
wayland/wayland.odin. - Generate all installed protocols found in
wayland-protocols/(stable|staging|unstable)into matching paths underwayland/.
To use a different output directory:
./generate.sh /path/to/output./build-examples.shBinaries are put in examples/bin/.
./check-protocols.shThis first runs ./generate.sh, then runs odin check -file -no-entry-point for every generated .odin protocol file.
Direct scanner invocation:
odin run scanner -- \
-output-dir=./wayland \
-wayland-xml=/custom/path/wayland.xml \
-protocols-dir=/custom/path/wayland-protocolsBy default ./generate.sh will use pkg-config to locate:
- Core protocol:
wayland.xml(viawayland-scanner). - Protocols directory (via
wayland-protocols).
Defaults:
- Core protocol:
/usr/share/wayland/wayland.xml - Protocols:
/usr/share/wayland-protocols
Override:
export WAYLAND_XML=/custom/path/wayland.xml
export WAYLAND_PROTOCOLS_DIR=/custom/path/wayland-protocols
./generate.sh