Skip to main content

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. It is similar to GNOME's PaperWM and KDE's Karousel.

video

Archcraft Niri

Get Niri From ko-fi And Support Archcraft Development.

Installation

Follow the instructions below to install Niri :

  • Download niri_YYYY-MM-DD.tar.gz file from ko-fi, and save it in a directory.
  • Open a terminal in same directory and run the following command to extract the tar file :
$ tar -xzvf niri_YYYY-MM-DD.tar.gz
  • Once the file is extracted, change to the extracted directory which should be niri

On Archcraft, You can simply install the provided packages in pkgs directory :

$ sudo pacman -U archcraft-niri-X.Y-Z-any.pkg.tar.zst
Archcraft Prime / WSE

Niri does not come pre-installed on Archcraft WSE and Archcraft Prime ISOs.

Configuration

Niri is pre-configured in Archcraft. In this section, We'll see how the Niri wayland compositor is configured, what tools and utilities are used to make it look and work like a complete desktop environment.

Config Structure

The configuration structure of Niri in Archcraft looks something like this:

~/.config
└── niri : niri config directory
├── alacritty : alacritty terminal config
├── foot : foot terminal config
├── kitty : kitty terminal config
├── mako : notification daemon config
│   └── icons : notification icons
├── rofi : rofi config files
├── scripts : various scripts for functionality
├── theme : current theme and pywal themes
├── wallpapers : wallpapers
├── waybar : statusbar config
├── wlogout : wlogout config
│   └── icons : session icons
├── config.kdl : niri config file
└── hyprlock.conf : lockscreen config file

Terminal

Alacritty is the default terminal. In the Niri wayland compositor, alacritty is launched with an alternative config file. If you need to change anything, make sure you modify the config files in ~/.config/niri/alacritty directory. These are the following config files you can modify to change the behaviour of your alacritty terminal:

~/.config/niri/alacritty/alacritty.toml : Main configuration file
~/.config/niri/alacritty/colors.toml : Colors configurations
~/.config/niri/alacritty/fonts.toml : Fonts configurations

If you need any help with alacritty config, run : man 5 alacritty in terminal.

tip

By Default, alacritty is used But, If you want to use kitty/foot as your default terminal, just edit the ~/.config/niri/config.kdl file and comment the keybindings for Terminal : alacritty and uncomment the bindings for Terminal : kitty or Terminal : foot

warning

When you change the theme, the colors.toml file of alacritty, colors.conf file of kitty and colors.ini file of foot get overwritten by the theme script.

Notification

Mako is used as a notification daemon for notifications in Niri. In the Niri wayland compositor, mako is launched with an alternative config file, which is ~/.config/niri/mako/config. So, If you need to modify anything, make sure you edit this file.

If you need any help with mako config, run : man 5 mako in terminal.

warning

When you change the theme, the colors in config file get overwritten by the theme script.

Wallpaper

swaybg sets the wallpaper in the Niri. If you want to change the wallpaper, Edit ~/.config/niri/scripts/wallpaper script and add your wallpaper here :

WALLPAPER='/path/to/your/wallpaper'
warning

When you change the theme, the wallpaper path in wallpaper script get overwritten by the theme script.

Statusbar

Waybar is used as the statusbar in Archcraft's Niri wayland compositor.

The configurations for waybar can be found inside ~/.config/niri/waybar. If you want to modify the waybar settings, or perhaps want to add/remove modules, then you need to edit the following files :

~/.config/niri/waybar/config : Main config file
~/.config/niri/waybar/modules : Modules config file
~/.config/niri/waybar/style.css : CSS file for styling
~/.config/niri/waybar/colors.css : CSS colors file

If you need any help with waybar config, run : man waybar

warning

When you change the theme, the colors.css file of waybar get overwritten by the theme script.

Launchers and Applets

Rofi is used for application launchers, command runner and various applets. To modify the rofi config, edit ~/.config/rofi/config.rasi file.

If you need any help with rofi config, run : man rofi in terminal.

The scripts for rofi that are used in Niri can be found it ~/.config/niri/scripts directory. These are the following scripts that uses rofi to provide the launchers and applets in Niri :

rofi_asroot : applet to run apps as root user
rofi_bluetooth : bluetooth applet to quickly connect to BT devices
rofi_launcher : an application launcher, cmd runner, file manager and task manager
rofi_music : music applet, that controls MPD with mpc
rofi_network : network manager applet
rofi_powermenu : power menu, with confirmation dialog
rofi_runner : quickly lets you run a command
rofi_screenshot : screenshot applet that works with grim

If you want to modify any applet or perhaps want to extend the functionality of the applet, just edit these scripts.

The configuration of each script can be found inside ~/.config/niri/rofi directory.

Let's say that you want to modify the looks of launcher, then you need to edit the ~/.config/niri/rofi/launcher.rasi file. Same goes for every other applet, Edit the respective file in the same directory.

If you need any help with rofi theming, run : man rofi-theme in terminal.

To change the colors and fonts of the launchers and applets, Edit the ~/.config/niri/rofi/shared/colors.rasi and ~/.config/niri/rofi/shared/fonts.rasi files.

warning

When you change the theme, the shared/colors.rasi file of rofi gets overwritten by the theme script.

wayland compositor

The configuration of Niri is available in ~/.config/niri. To configure Niri wayland compositor, Edit this file:

config.kdl : main configuration file for Top-level, layout, input/output, keybindings and window rules settings, etc

If you need any help with niri configuration, visit : Niri Wiki

warning

When you change the theme, colors in config.kdl file gets overwritten by the theme script.

Keybindings

Here's a list of some important keybinds you need to know for operating Niri easily. If you want to view, modify or add new keybinds, Edit ~/.config/niri/config.kdl file.

Applications

KeysAction
super + ReturnOpen terminal
super + shift + ReturnOpen floating terminal
super + TOpen fullscreen terminal
super + shift + FOpen file manager (thunar)
super + shift + EOpen text editor (geany)
super + shift + WOpen web browser (firefox)
KeysAction
super + DOpen application launcher
Alt + F1Open application launcher
Alt + F2Open command runner
super + NOpen network manager applet
super + MOpen music applet
super + XOpen powermenu applet
super + ROpen asroot applet
super + SOpen screenshots applet
super + BOpen bluetooth applet

Hardware Keys

KeysAction
PrintTake screenshot
alt + PrintTake screenshot in 5 seconds delay
shift + PrintTake screenshot in 10 seconds delay
ctrl + PrintTake screenshot of currently focused window
super + PrintTake screenshot of selected area
XF86AudioRaiseVolumeIncrease volume
XF86AudioLowerVolumeDecrease volume
XF86AudioMuteToggle mute speakers
XF86AudioMicMuteToggle mute microphone
XF86Audio + Next/Prev/Play/StopMedia controls (MPD)
XF86MonBrightnessUpIncrease display brightness
XF86MonBrightnessDownDecrease display brightness

Window Management

KeysAction
super + OOpen/close the Overview
super + QClose the focued window
super + FMaximize the focused column
super + ctrl + FExpand the focused column to available space
super + CCenter the focused column on the screen
super + ctrl + CCenter all fully visible columns on screen
super + SpaceMove the focused window between the floating and the tiling layout
super + shift + SpaceSwitch focus between the floating and the tiling window
super + WToggle tabbed column display mode
super + Left/Right/Up/DownFocus the column/window respectively
super + ctrl + Left/Right/Up/DownMove the column/window respectively
super + Home/EndFocus first/last column
super + ctrl + Home/EndMove b/w first/last column
super + shift + Left/Right/Up/DownFocus monitors respectively
super + shift + H/J/K/LFocus monitors respectively
super + shift + ctrl + Left/Right/Up/DownMove b/w monitors respectively
super + shift + ctrl + H/J/K/LMove b/w monitors respectively
super + Page_Down/Page_UpFocus to upper/lower workspaces
super + U/IFocus to upper/lower workspaces
super + ctrl + Page_Down/Page_UpMove to upper/lower workspaces
super + ctrl + U/IMove to upper/lower workspaces
super + shift + Page_Down/Page_UpMove a single window to upper/lower workspaces
super + shift + U/IMove a single window to upper/lower workspaces
super + 1..9Focus respective workspace
super + ctrl + 1..9Move column to respective workspace
super + TabSwitches focus between the current and the previous workspace
super + BracketLeftConsume or expel left window
super + BracketRightConsume or expel right window
super + CommaConsume one window from the right to the bottom of the focused column
super + PeriodExpel the bottom window from the focused column to the right
super + GSwitch to preset column width
super + shift + GSwitch to preset window height
super + ctrl + GReset window height
super + MinusSet column width by -10%
super + EqualSet column width by +10%
super + shift + MinusSet column height by -10%
super + shift + EqualSet column height by +10%

Misc Keys

KeysAction
super + shift + Slashshows a list of important hotkeys
super + shift + PPowers off the monitors
super + PRun colorpicker
ctrl + alt + LTrigger lockscreen
ctrl + alt + DeleteQuit Niri

Touchpad Gestures

GestureAction
super + SwipeUpIncrease display brightness
super + SwipeDownDecrease display brightness
swipe-3 Left/RightFocus/Scroll the windows
swipe-3 Up/DownChange the workspace
swipe-4Open the Overview

Nvidia

If you're on Archcraft and install the provided package, There's nothing else you need to do in order to run it on Nvidia machine. When you install Archcraft on a machine that has Nvidia, It does all the operations (mentioned below) required to run a wayland compositor on such machines. The compositor should work fine.

If you're running any other distribution and want to install this setup on your Nvidia machine, You need to do some tweaking. In this guide, I'm assuing you're using Arch Linux. Follow the steps below to make this wayland compositor work on Nvidia :

  • Install Nvidia Drivers on your system. NVIDIA
  • Edit /etc/mkinitcpio.conf file and add nvidia kernel modules
MODULES="nvidia nvidia_modeset nvidia_uvm nvidia_drm"
  • In the same file, Remove kms hook from hooks array if present.
  • Rebuild your initrd file with : sudo mkinitcpio -P linux
  • Edit /etc/default/grub file and add nvidia_drm.modeset=1 kernel parameter for Nvidia
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia_drm.modeset=1 ..."
  • Update your grub config file with : sudo grub-mkconfig -o /boot/grub/grub.cfg
  • Reboot your Nvidia Machine and login to your wayland compositor, It should work now.

More Information: NVIDIA#Installation, NVIDIA#DRM_kernel_mode_setting

Screenshots

Desktop

Here's few screenshots of Niri desktop. These'll give you an idea of the experience of Niri in Archcraft.

Desktop 1Desktop 2Desktop 3Desktop 4Desktop 5
imgimgimgimgimg
Desktop 6Desktop 7Desktop 8Desktop 9Desktop 10
imgimgimgimgimg
Desktop 11Desktop 12Desktop 13Desktop 14Desktop 15
imgimgimgimgimg
Desktop 16Desktop 17Desktop 18Desktop 19
imgimgimgimg

Themes

To Change the theme, Click on Color Palette icon on waybar. To apply a random theme, Left Click on the theme module and To restore the default theme, Right Click on the theme module.

To switch between Light/Dark mode, click on module with moon/sun icons.

Default ThemeRandom ThemesWorkspacesLockscreen
imggifgifgif

FAQs

How to update my config to new configs?

Download the updated package from ko-fi (for free) and just install it to update to new configs.

Steps to get updates (or re-download files):

  • Login to you Ko-fi account
  • Go to your Ko-fi Payments History
  • Select the purchases you've made
  • Click on View Details
  • Then, Click on View Content to download the updated files.
Why my cursor is not visible?

When using certain graphics drivers (e.g. the VMSVGA graphics controller or the proprietary NVIDIA dhypr), the cursor is invisible. This can be fixed by using software cursors :

$ export WLR_NO_HARDWARE_CURSORS=1
How to change GTK theme, icons and cursor?

To change GTK theme, icons and cursor in Niri session, Edit ~/.config/niri/scripts/gtkthemes script and restart Niri to apply the changes.

THEME='Sweet-Dark'
ICONS='Glassy'
FONT='Noto Sans 9'
CURSOR='Sweet'
How to manage multiple monitors and resolution in Niri?

If you use multiple monitors with Niri wayland compositor, you can manage them as follow:

  1. You can get the names of your outputs with niri msg outputs
  2. Edit ~/.config/niri/config.kdl file and use the information you get by the command above:
output "eDP-1" {
//off
mode "1920x1080@60.027"
scale 1.0
transform "normal"
position x=0 y=0
variable-refresh-rate
focus-at-startup
background-color "#1b202f"
backdrop-color "#252b3f"
}

output "HDMI-A-1" {
//off
mode "1920x1080@60.000"
scale 1.0
transform "normal"
position x=1920 y=0
variable-refresh-rate on-demand=true
focus-at-startup
background-color "#1b202f"
backdrop-color "#252b3f"
}
Why Alacritty is not working on my computer?

Since Alacritty is a OpenGL based terminal emulator, It may not work on some computer hardwares. You can make it work on such computers by following these methods :

  1. Open alacritty with LIBGL_ALWAYS_SOFTWARE=1 variable. Edit the keybindings/script launching alacritty and replace alacritty with LIBGL_ALWAYS_SOFTWARE=1 alacritty
  2. Edit /usr/share/applications/Alacritty.desktop desktop file and replace Exec=alacritty with Exec=env LIBGL_ALWAYS_SOFTWARE=1 alacritty