- Zig 69.7%
- Python 30.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| example | ||
| scripts | ||
| src | ||
| .gitignore | ||
| build.zig | ||
| build.zig.zon | ||
| README.md | ||
zig-neuipc
zig 0.16 bindings and a Zig-friendly wrapper for neuipc, the lightweight Unix domain socket IPC layer for Wayland compositors.
The intent is to keep the line-oriented command and subscription model of the C library, while giving Zig code a simpler surface for commands, events, and socket lifecycle handling.
Build
Validate the Zig wrapper and generated IPC bindings:
zig build
Build the example programs:
zig build -Dexample=true
Run the demo server and client from the repository root:
./zig-out/bin/example-server
./zig-out/bin/example-client ping
./zig-out/bin/example-client sub heartbeat
Protocol
Commands are sent as a single line:
command arg1 arg2
Replies are:
ok <msg>
err <msg>
Subscriptions use:
sub <topic>
sub *
The connection stays open after subscription, and the server pushes
topic <msg> lines as events occur.
The example binaries use an abstract Unix socket name so they do not depend on filesystem socket cleanup during local testing.
API
The intended Zig surface mirrors the C library closely, but should read like a native Zig API:
var server = try neuipc.Server.init(allocator, "/tmp/neuipc.sock");
defer server.deinit();
try server.register("ping", handlePing, null);
try server.dispatch();
_ = try server.emit("heartbeat", "tick {}", .{tick});