Anvil

August 10, 2025 ยท View on GitHub

A compositor used as a testing ground for new smithay features. For a simple example compositor consider reading smallvil

Dependencies

You'll need to install the following dependencies (note, that those package names may vary depending on your OS and linux distribution):

  • libwayland
  • libxkbcommon

These are needed for the "Udev/DRM backend"

If you want to enable X11 support (to run X11 applications within anvil), then you'll need to install the following packages as well: - xwayland

Build and run

You can run it with cargo after having cloned this repository:

cd anvil;

cargo run -- --{backend}

The currently available backends are:

  • --x11: start anvil as an X11 client. This allows you to run the compositor inside an X11 session or any compositor supporting XWayland. Should be preferred over the winit backend where possible.
  • --winit: start anvil as a Winit application. This allows you to run it inside of an other X11 or Wayland session.
  • --tty-udev: start anvil in a tty with udev support. This is the "traditional" launch of a Wayland compositor. Note that this requires you to start anvil as root if your system does not have logind available.

Supported Environment Variables

VariableExampleBackends
ANVIL_DRM_DEVICE/dev/dri/card0tty-udev
ANVIL_DISABLE_10BITanytty-udev
ANVIL_DISABLE_DIRECT_SCANOUTanytty-udev
ANVIL_GLES_DISABLE_INSTANCINGanytty-udev
ANVIL_NO_VULKAN1,true,yes,yx11
SMITHAY_USE_LEGACY1,true,yes,ytty-udev
SMITHAY_VK_VERSION1.3