Niri
Niri is a scrollable tiling Wayland compositor. Unlike, Sway or Hyprland, Niri arranges the windows in an infinite horizontal desktop, where you can scroll to the left or to the right (although more advanced layouts are possible). It is similar to GNOME's PaperWM and KDE's Karousel.
Installation
Niri can be installed with the niri package. Additionally, to have a better experience, you may want to install:
- fuzzel: default application launcher in Niri
- mako: notifications
- waybar: a Wayland bar
- xdg-desktop-portal-gtk, xdg-desktop-portal-gnome: to be able to do screen sharing
- alacritty: default terminal in Niri
- swaybg: background image
- swayidle, swaylock: to lock the screen on idle status
Starting
The niri package contains a session which should be recognized automatically by modern display managers like GDM and SDDM.
Configuration
Niri reads the configuration from ~/.config/niri/config.kdl
. It is a KDL file, divided by sections. The default configuration, created on the first run, has lots of comments of which options to configure. Every time you save the file, Niri will try to apply the configuration.
Keymap
To configure the keymap, edit the input/keyboard/xkb
section. For example, if you want to have a "US Int Alt Gr" layout with CapsLock
acting as Ctrl
key:
~/.config/niri/config.kdl
input { keyboard { xkb { layout "us" variant "altgr-intl" options "ctrl:nocaps" } } ... }
Outputs
First run niri msg outputs
to get an overview of the outputs recognized by Niri. Then you can apply configs to each monitor. For example to set the HDMI monitor to 2560x1440 60Hz with a 1.2 scaling, and turning off the laptop monitor, set the following:
~/.config/niri/config.kdl
output "HDMI-A-1" { mode "2560x1440@60.000" scale 1.2 } output "eDP-1" { off }
Bindings
The binds section allows to set up the different key combinations that have effect on Niri. By default, there are many of them already set, so you can study them. But everything is remappable. Bindings are defined using the modifiers keys appended with a +
sign and the action between brackets. The special action spawn will launch a program. For example, you will find the following bindings that spawn alacritty and fuzzel on Mod+T
and Mod+D
respectively. Mod
is usually the Super
key if running standalone, but it is Alt
if it is running inside of another compositor.
~/.config/niri/config.kdl
binds { ... Mod+T { spawn "alacritty"; } Mod+D { spawn "fuzzel"; } ... }
WASD-like navigation
It is possible to configure Niri workspaces and bindings so that jumping through windows follows a navigation similar to WASD as in games.
~/.config/niri/config.kdl
binds { ... Mod+A { focus-column-left; } Mod+S { focus-window-or-workspace-down; } Mod+W { focus-window-or-workspace-up; } Mod+D { focus-column-right; } ... }
Be aware that this config will probably need other bindings to be remapped as well. Also, some people may prefer to have the WASD navigation on the right hand side, or have a more Vim-like navigation.
Spawn at startup
Niri allows some programs to be started alongside with Niri. For example, some of programs mentioned beforehand like mako, waybar and swayidle/swaylock can be configured:
~/.config/niri/config.kdl
spawn-at-startup "mako" spawn-at-startup "waybar" spawn-at-startup "swayidle -w timeout 601 'niri msg action power-off-monitors' timeout 600 'swaylock -f' before-sleep 'swaylock -f'"