A tiny, zero dependency, Wayland Compositor
MIT License
(or about 3000 lines of code you would have to write anyway....)
Nyctal is a prototype wayland compositor, written in Go with zero[^1] dependencies. If you have only a Go compiler you should be able to compile Nyctal and direct applications to use it as a display server.
([^1]: Ok, technically there is a dependency on golang.org/x/sys
, which isn't part of the go standard library, but it's close enough that I'm going to claim mission success.)
Nyctal is not a drop-in replacement for any of the well-engineered, feature-full display servers out there. You will probably want to use something based on wl_roots.
Nyctal was written to be used as a base for building your own display server, probably to be deployed on custom kernels or in very-opinionated setups. The base code of Nyctal is not aware of systemd, or dbus, or seats or another other modern linux "standard" services.
To put it plainly: You probably don't want to use Nyctal, and even if you do you almost certainly will want to fork the code and build your own window management logic.
I built Nyctal because I like building operating systems as a hobby and have been wanting a small, easily maintainable display server for those projects and has the potential to be compatible with more mainstream applications.
There are currently two example applications that can be used to try out Nyctal:
input
and video
devices (see instructions in the linked folder).Ensure that any apps are run in an environment setting XDG_RUNTIME_DIR=/tmp/nyctal/
and WAYLAND_DISPLAY=nyctal-0
Nyctal can currently interact and render a wide range of applications, some that I've tested include:
Nyctal will currently fail to interact with anything that expects to be able to use the dmabuf extension (so flags like LIBGL_ALWAYS_SOFTWARE=1
and __GLX_VENDOR_LIBRARY_NAME=mesa
are needed when running applications to force software rendering)
Nyctal also doesn't support extensions that most video apps (like mpv) need.
Nyctal aims to supports the bare-minimum of wayland needed to run most basic applications. In practice that means that Nyctal currently supports:
wl_shell
which is deprecated)
wl_shell
is deprecated)
Given time, Nyctal also aims to support:
It is incredibly unlikely that Nyctal will ever have X11 protocol support, or support for the more niche wayland protocols (e.g. those designed to directly integrate with a given compositor) - but if you think you have a way of introducing such support in a way that aligns with the goals of the project then I await your pull request!
Nyctal only supports sending linux scancodes to applications, with all the inherent limitations of that approach. PRs that introduce support for xkbcommon keymaps (while aligning with the goals of the project) are welcome.