{"id":13626701,"url":"https://github.com/ifreund/zig-wayland","last_synced_at":"2025-10-10T05:13:26.049Z","repository":{"id":40384241,"uuid":"295240683","full_name":"ifreund/zig-wayland","owner":"ifreund","description":"[mirror] Zig Wayland scanner and libwayland bindings","archived":false,"fork":false,"pushed_at":"2025-08-22T12:39:39.000Z","size":420,"stargazers_count":113,"open_issues_count":2,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-22T14:43:55.423Z","etag":null,"topics":["wayland","zig"],"latest_commit_sha":null,"homepage":"https://codeberg.org/ifreund/zig-wayland","language":"Zig","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ifreund.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ifreund","liberapay":"ifreund"}},"created_at":"2020-09-13T21:27:03.000Z","updated_at":"2025-08-22T13:56:23.000Z","dependencies_parsed_at":"2024-03-02T17:29:17.485Z","dependency_job_id":"617fe315-f39d-4a43-b7f0-7fa55d6e1805","html_url":"https://github.com/ifreund/zig-wayland","commit_stats":{"total_commits":214,"total_committers":13,"mean_commits":16.46153846153846,"dds":"0.46261682242990654","last_synced_commit":"b72ef788eb5da9957c21cc50772e3ff7bc77a69d"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ifreund/zig-wayland","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifreund%2Fzig-wayland","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifreund%2Fzig-wayland/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifreund%2Fzig-wayland/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifreund%2Fzig-wayland/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ifreund","download_url":"https://codeload.github.com/ifreund/zig-wayland/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ifreund%2Fzig-wayland/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002793,"owners_count":26083468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["wayland","zig"],"created_at":"2024-08-01T21:02:27.048Z","updated_at":"2025-10-10T05:13:26.043Z","avatar_url":"https://github.com/ifreund.png","language":"Zig","funding_links":["https://github.com/sponsors/ifreund","https://liberapay.com/ifreund"],"categories":["Zig","Libraries"],"sub_categories":[],"readme":"# zig-wayland\n\nZig 0.15 bindings and protocol scanner for libwayland.\n\nThe main repository is on [codeberg](https://codeberg.org/ifreund/zig-wayland),\nwhich is where the issue tracker may be found and where contributions are accepted.\n\nRead-only mirrors exist on [sourcehut](https://git.sr.ht/~ifreund/zig-wayland)\nand [github](https://github.com/ifreund/zig-wayland).\n\n## Usage\n\nA `Scanner` interface is provided which you may integrate with your `build.zig`:\n\n```zig\nconst std = @import(\"std\");\nconst Build = std.Build;\n\nconst Scanner = @import(\"wayland\").Scanner;\n\npub fn build(b: *Build) !void {\n    const target = b.standardTargetOptions(.{});\n    const optimize = b.standardOptimizeOption(.{});\n\n    const scanner = Scanner.create(b, .{});\n\n    const wayland = b.createModule(.{ .root_source_file = scanner.result });\n\n    scanner.addSystemProtocol(\"stable/xdg-shell/xdg-shell.xml\");\n    scanner.addSystemProtocol(\"staging/ext-session-lock/ext-session-lock-v1.xml\");\n    scanner.addCustomProtocol(b.path(\"protocol/private_foobar.xml\"));\n\n    // Pass the maximum version implemented by your wayland server or client.\n    // Requests, events, enums, etc. from newer versions will not be generated,\n    // ensuring forwards compatibility with newer protocol xml.\n    // This will also generate code for interfaces created using the provided\n    // global interface, in this example wl_keyboard, wl_pointer, xdg_surface,\n    // xdg_toplevel, etc. would be generated as well.\n    scanner.generate(\"wl_seat\", 4);\n    scanner.generate(\"xdg_wm_base\", 3);\n    scanner.generate(\"ext_session_lock_manager_v1\", 1);\n    scanner.generate(\"private_foobar_manager\", 1);\n\n    const exe = b.addExecutable(.{\n        .name = \"foobar\",\n        .root_module = b.createModule(.{\n            .root_source_file = b.path(\"foobar.zig\"),\n            .target = target,\n            .optimize = optimize,\n        }),\n    });\n\n    exe.root_module.addImport(\"wayland\", wayland);\n    exe.linkLibC();\n    exe.linkSystemLibrary(\"wayland-client\");\n\n    b.installArtifact(exe);\n}\n```\n\nThen, you may import the provided module in your project:\n\n```zig\nconst wayland = @import(\"wayland\");\nconst wl = wayland.client.wl;\n```\n\nThere is an example project using zig-wayland here in the\n[example/hello](./example/hello) directory of this repository.\n\nNote that zig-wayland does not currently do extensive verification of Wayland\nprotocol xml or provide good error messages if protocol xml is invalid. It is\nrecommend to use `wayland-scanner --strict` to debug protocol xml instead.\n\n## Versioning\n\nFor now, zig-wayland versions are of the form `0.major.patch`. A major version\nbump indicates a zig-wayland release that breaks API or requires a newer Zig\nversion to build. A patch version bump indicates a zig-wayland release that is\nfully backwards compatible.\n\nFor unreleased versions, the `-dev` suffix is used (e.g. `0.1.0-dev`).\n\nThe version of zig-wayland currently has no direct relation to the upstream\nlibwayland version supported.\n\nBreaking changes in zig-wayland's API will be necessary until a stable Zig 1.0\nversion is released, at which point I plan to switch to a new versioning scheme\nand start the version numbers with `1` instead of `0`.\n\n## License\n\nzig-wayland is released under the MIT (expat) license.\n\nThe contents of the hello-zig-wayland directory are not part of zig-wayland and are released under the Zero Clause BSD license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifreund%2Fzig-wayland","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fifreund%2Fzig-wayland","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fifreund%2Fzig-wayland/lists"}