Thinking of building a high-level Wayland toolkit (SCTK style). Is it needed?

Hey everyone,

I’ve been spending some time with zig-wayland lately. While the bindings themselves are great (big thanks to ifreund and contributors), the amount of boilerplate required just to get a basic xdg_toplevel up and running feels pretty heavy.

Coming from Rust, I really miss what smithay-client-toolkit (SCTK) does. It abstracts away the repetitive negotiation logic so you can just focus on drawing a window.

I’m seriously considering building a Zig equivalent. It would sit on top of zig-wayland and handle the “boring” stuff: dynamic registry handling, output scaling, and xdg_shell state.

But before I commit the time, I wanted to make sure I’m not misreading the ecosystem:

  1. Is the “raw” approach actually preferred? I know the Zig ethos leans heavily toward “no hidden control flow.” If I make a library that manages the wl_registry loop and seat capabilities for you, is that too much magic? Do you guys prefer manually handling the globals to keep full control?

  2. Why doesn’t this exist yet? I’ve looked at projects like shimizu (and looked through mach’s source), but there doesn’t seem to be a standalone, “batteries-included” client lib that everyone uses. Is this because previous attempts hit a wall, or just because everyone prefers rolling their own implementation?

Basically, if I build this to reduce friction, is it something you’d actually use, or is the complexity of an abstraction layer not worth it for you?

Thanks.

2 Likes

Hi @Pepengu, welcome to Ziggit.

I think there is room for both the “raw” approach and a more batteries included approach. Zig is still young and the ecosystem is growing. There isn’t a client toolkit yet because no one has built it yet.
That being said, a lot of the people interested in Zig so far are not afraid of these lower level APIs, so if it has been a concern, it’s not one that we have built around yet. We need people like you who see a need and want to fill it.

If it is something you are interested in, by all means, build it. If it is something you want to build with, then build if for yourself, share the progress and someone else will probably find it useful and build with it too.

1 Like

I had the same question, so I’ve started (very slowly) building out a library of my own, so I can stop writing the low-level platform code over and over. Mine is intended to be cross-platform, but currently only has the Wayland bits fleshed out. (Not yet ready for prime time and very incomplete, but I’ve already started using it in a couple small projects.)

1 Like