Overview
When building niri, checkCargo.toml for a list of build features.
The
niri-visual-tests sub-crate/binary is development-only and should not be packaged.File Installation
The recommended way to package niri is so that it runs as a standalone desktop session. To do that, put files into the correct directories according to this table:| File | Destination |
|---|---|
target/release/niri | /usr/bin/ |
resources/niri-session | /usr/bin/ |
resources/niri.desktop | /usr/share/wayland-sessions/ |
resources/niri-portals.conf | /usr/share/xdg-desktop-portal/ |
resources/niri.service (systemd) | /usr/lib/systemd/user/ |
resources/niri-shutdown.target (systemd) | /usr/lib/systemd/user/ |
resources/dinit/niri (dinit) | /usr/lib/dinit.d/user/ |
resources/dinit/niri.target (dinit) | /usr/lib/dinit.d/user/ |
Doing this will make niri appear in GDM and other display managers.
Recommended Dependencies
Required Runtime Dependencies
Optional but Strongly Recommended
The following dependencies are optional, but strongly recommended. Set them as automatically-installed optional dependencies, if possible:xwayland-satellite
Required to run X11 applications (Steam, Discord, etc.)
xdg-desktop-portal-gnome
Required for screencasting
xdg-desktop-portal-gtk
Configured as the fallback portal in
niri-portals.conf. This is the standard fallback portal you want installed.gnome-keyring
Configured as the Secret portal provider in
niri-portals.confGPU drivers
Such as
mesa-dri-drivers and mesa-libEGL. Working hardware acceleration is required for running niri.Notification daemon
Such as
mako, generally required for apps to work correctlyspawn), such as alacritty and fuzzel.
Running Tests
A bulk of our tests spawn niri compositor instances and test Wayland clients. This does not require a graphical session, however due to test parallelism, it can run into file descriptor limits on high core count systems.Don’t forget to exclude the development-only
niri-visual-tests crate when running tests.Skipping EGL Tests
Some tests require surfaceless EGL to be available at test time. If this is problematic, you can skip them:Version String
The niri version string includes its version and commit hash:Setting the Commit Hash
In this case, please set the commit hash manually:Overriding the Version String
You can also override the version string entirely. Make sure the corresponding niri version stays intact:Panics
Good panic backtraces are required for diagnosing niri crashes.Test panic backtraces
Use the
niri panic command to test that your package produces good backtraces:Rust Dependencies
Every niri release comes with a vendored dependencies archive fromcargo vendor. You can use it to build the corresponding niri release completely offline.
If you don’t want to use vendored dependencies, consider following the niri release’s
Cargo.lock. It contains the exact dependency versions that were used when testing the release.smithay and smithay-drm-extras
Shell Completions
You can generate shell completions for several shells vianiri completions <SHELL>.