A scrollable-tiling Wayland compositor.
Go to file
2023-10-11 11:56:38 +04:00
.github/workflows Make pipewire / xdp-gnome-screencast optional 2023-09-30 09:58:34 +04:00
resources Add screenshot-window action 2023-10-10 12:42:24 +04:00
src layout: Store location in FocusRing 2023-10-11 11:56:38 +04:00
.gitignore Init from smallvil 2023-08-10 14:49:38 +04:00
Cargo.lock Upgrade dependencies 2023-10-07 18:01:17 +04:00
Cargo.toml Make zbus optional under "dbus" feature 2023-10-10 10:25:33 +04:00
LICENSE Add LICENSE 2023-08-10 14:50:51 +04:00
README.md Update screenshot binds in README 2023-10-10 12:50:17 +04:00
rustfmt.toml Add rustfmt.toml and reformat 2023-08-10 14:49:38 +04:00

niri

A scrollable-tiling Wayland compositor.

Status

Work in progress. Many things work, but some pieces of functionality expected of a Wayland compositor are missing. Also, have your waybars and fuzzels ready: niri is not a complete desktop environment.

https://github.com/YaLTeR/niri/assets/1794388/3713a563-d7a2-4c56-aa0b-b4986b5dc188

Idea

Niri implements scrollable tiling, heavily inspired by PaperWM. Windows are arranged in columns on an infinite strip going to the right. Every column takes up a full monitor worth of height, divided among its windows.

With multiple monitors, every monitor has its own separate window strip. Windows can never "overflow" onto an adjacent monitor.

This is one of the reasons that prompted me to try writing my own compositor. PaperWM is a solid implementation, but, being a GNOME Shell extension, it has to work around Shell's global window coordinate space to prevent windows from overflowing.

Niri also has dynamic workspaces which work similar to GNOME Shell. Since windows go left-to-right horizontally, workspaces are arranged vertically. Every monitor has an independent set of workspaces, and there's always one empty workspace present all the way down.

Niri tries to preserve the workspace arrangement as much as possible upon disconnecting and connecting monitors. When a monitor disconnects, its workspaces will move to another monitor, but upon reconnection they will move back to the original monitor.

Running

cargo run --release

Inside a desktop session, it will run in a window. On a TTY, it will run natively.

To exit when running on a TTY, press SuperShiftE.

Session

You can install and run niri as a standalone desktop session. Check the generate-rpm metadata at the bottom of Cargo.toml to see which files go where. After installing, you can choose the niri session in GDM and, presumably, other display managers.

The niri session will autostart apps through the systemd xdg-autostart target. You can also autostart systemd services like mako by symlinking them into $HOME/.config/systemd/user/niri.service.wants/.

Niri also works with some parts of xdg-desktop-portal-gnome. In particular, it supports file choosers and monitor screencasting (e.g. to OBS).

Default Hotkeys

When running on a TTY, the Mod key is Super. When running in a window, the Mod key is Alt.

The general system is: if a hotkey switches somewhere, then adding Ctrl will move the focused window or column there.

Hotkey Description
ModT Spawn alacritty
ModQ Close the focused window
ModH or Mod Focus the column to the left
ModL or Mod Focus the column to the right
ModJ or Mod Focus the window below in a column
ModK or Mod Focus the window above in a column
ModCtrlH or ModCtrl Move the focused column to the left
ModCtrlL or ModCtrl Move the focused column to the right
ModCtrlJ or ModCtrl Move the focused window below in a column
ModCtrlK or ModCtrl Move the focused window above in a column
ModShiftHJKL or ModShift Focus the monitor to the side
ModCtrlShiftHJKL or ModCtrlShift Move the focused window to the monitor to the side
ModU or ModPageDown Switch to the workspace below
ModI or ModPageUp Switch to the workspace above
ModCtrlU or ModCtrlPageDown Move the focused window to the workspace below
ModCtrlI or ModCtrlPageUp Move the focused window to the workspace above
Mod19 Switch to a workspace by index
ModCtrl19 Move the focused window to a workspace by index
Mod, Consume the window to the right into the focused column
Mod. Expel the focused window into its own column
ModR Toggle between preset column widths
ModF Maximize column
Mod- Decrease column width by 10%
Mod= Increase column width by 10%
ModShiftF Toggle full-screen on the focused window
PrtSc Take a screenshot to clipboard and to ~/Pictures/Screenshots/
AltPrtSc Take a screenshot of the focused window to clipboard and to ~/Pictures/Screenshots/
ModCtrlShiftT Toggle debug tinting of rendered elements
ModShiftE Exit niri

Configuration

Niri will load configuration from $XDG_CONFIG_HOME/.config/niri/config.kdl or ~/.config/niri/config.kdl. If this fails, it will load the default configuration file. Please use the default configuration file as the starting point for your custom configuration.