From Engineer to Power User: Adopting and Customizing the niri Compositor


From Engineer to Power User: Adopting and Customizing the niri Compositor

YaLTeR/niri

2025-10-09

niri is a relatively new, highly-polished Wayland compositor written in Rust. It stands out from traditional tiling window managers like i3 or Sway due to its unique "scrollable-tiling" model.

As a software engineer, your workflow often involves managing a large number of applications
an IDE, multiple terminals, browsers for documentation, API clients, and more. niri can significantly boost your productivity and focus by addressing common pain points of traditional window managers

In traditional tiling WMs, every time you open or close a window, all other windows on the screen are automatically resized. This can be jarring and disruptive to your focus.

niri's Advantage
Windows are placed in an "infinite" horizontal strip on your workspace. When you open a new window, existing windows keep their original size. You simply "scroll" horizontally (or move focus) to bring the next window into view. This creates a much more stable and predictable environment for tasks like coding or debugging.

The scrollable nature allows you to keep an unlimited number of windows on a single dynamic workspace, making them feel like a continuous train of thought.

Software Engineer Use Case
Dedicate one workspace to a specific project or task (e.g., "Feature X Development"). You can have your code editor, a couple of terminal panes, and a browser with the relevant documentation all lined up. When you switch to a different project/workspace, your entire context for the previous task is perfectly preserved and organized for when you scroll back to it.

niri is built in Rust, a language known for its focus on safety, speed, and concurrency.

Engineer Utility
This translates to a compositor that is generally highly stable, fast, and resource-efficient. You can worry less about your window manager crashing and more about your code. It uses the smithay library instead of the more common wlroots, offering a different, modern, and high-performance foundation.

niri treats multi-monitor setups as a core part of its design, with each display having its own separate set of dynamic workspaces. It also supports Mixed DPI environments and Fractional Scaling while keeping the niri UI pixel-perfect.

Engineer Utility
Essential for modern development setups. You can have your main coding workspace on one monitor and a completely separate set of workspaces (e.g., a documentation browser and a video meeting window) on another, with the correct scaling for each.

Like most advanced WMs, niri supports Inter-Process Communication (IPC).

Engineer Utility
This is crucial for automating your workflow. You can write simple shell scripts to query the state of your windows, move applications, open specific apps in specific configurations, or even implement your own tools like custom scratchpads (which are easily achievable using floating windows combined with IPC).

The easiest way to get started with niri is to install it using your distribution's package manager, as it is available in most popular repos (or through community efforts).

Check Your Distribution
niri is often available as the niri package.

Arch/EndeavourOS

# Install niri and some recommended utilities
sudo pacman -S niri fuzzel alacritty xdg-desktop-portal-gnome

NixOS
Available via a NixOS Flake.

Fedora
Available via COPR.

Start niri

Log out of your current session.

On your Display Manager (GDM, LightDM, SDDM, etc.), select "Niri" from the session list before logging in.

Alternatively, for a TTY (console) start, you can execute

niri-session

niri is highly keyboard-driven, using the Super key (usually the Windows key) as the main modifier, often called Mod.

ActionKeybindingDescription
Launch TerminalMod + TOpens the default terminal (e.g., Alacritty).
Launch LauncherMod + DOpens the application launcher (e.g., Fuzzel).
Close Focused WindowMod + Shift + CCloses the application.
Move Focus (Scroll)Mod + Left/RightScrolls the workspace to the previous/next window.
Move Focus (Up/Down)Mod + Up/DownMoves focus between windows stacked in a column.
Move WindowMod + Shift + Left/RightSwaps the window's position with its neighbor.
Cycle Window WidthMod + RCycles window width through preset sizes (e.g., 1/3, 1/2, 2/3).
Toggle FloatingMod + FMakes the focused window floating (for dialogs/popups).
Exit niriMod + Shift + EDisplays the exit confirmation dialog.

The power of niri for an engineer often comes down to its configuration file and IPC usage. The configuration is typically a TOML file located at ~/.config/niri/config.toml.

You can easily set up a custom keybinding to launch a specific development tool, like a web browser pointed at a local host, or a dedicated chat application on a floating layer.

In your ~/.config/niri/config.toml

# To launch your favorite IDE (e.g., VS Code)
[[keybind]]
key = "v"
mods = ["Super"]
command = "code"

# To open a browser to a specific development environment URL
[[keybind]]
key = "w"
mods = ["Super", "Shift"]
command = ["sh", "-c", "google-chrome-stable http://localhost:8080/ &"]

While niri supports floating windows, you can combine this with IPC to create a script that behaves like a scratchpad—an application that can be instantly shown or hidden with a single keypress.

Set up the IPC keybind in config.toml to call a script (e.g., niri-scratchpad-toggle.sh)

# Keybind to toggle a dedicated terminal scratchpad
[[keybind]]
key = "s"
mods = ["Super"]
command = ["/usr/local/bin/niri-scratchpad-toggle.sh"]

Create the Scratchpad Script (/usr/local/bin/niri-scratchpad-toggle.sh)

This is a simplified conceptual example. Actual implementation would use niri's client (like niri-cli) for full IPC control.

#!/bin/bash

SCRATCHPAD_APP="alacritty --title scratchpad"
WINDOW_TITLE="scratchpad"

# Check if the scratchpad window is already open and focused
if niri-cli get-windows | grep -q "\"title\": \"$WINDOW_TITLE\"" ; then
    # If open, hide/move it off-screen (or minimize if niri supported minimizing)
    # With niri, a common IPC trick is to move it to a specific, otherwise unused workspace.
    # Alternatively, if it's open, you just hide it by moving focus to another window.
    # For simplicity, let's just close it for now in this concept:
    niri-cli focus-window title:"$WINDOW_TITLE"
    niri-cli close-window
else
    # If not open, launch it and set it as floating for an overlay effect
    $SCRATCHPAD_APP &
    # A small delay might be needed for the window to appear
    sleep 0.5
    niri-cli float-window title:"$WINDOW_TITLE"
    # Optional: Set a specific size and position
    # niri-cli set-size title:"$WINDOW_TITLE" 800 600
fi

YaLTeR/niri




Building Games with Bevy: A Rust-Based, Data-Driven Approach

Bevy is an open-source, data-driven game engine written in Rust. From a software engineer's perspective, Bevy's most significant benefit is its Entity Component System (ECS) architecture


A Developer's Introduction to librespot-org's Spotify Library in Rust

Think of librespot as the core engine for building a custom Spotify experience. Instead of being limited to what the official Spotify API allows


Boost Productivity with cc-switch: Unified Configuration and Prompt Management for AI Coding Tools

cc-switch (farion1231/cc-switch) is a cross-platform desktop application written in Rust that acts as an All-in-One assistant tool for various AI-powered coding and development environments like Claude Code


A Developer's Perspective on vibe: Leveraging Rust for On-Device AI Transcription

Let's dive into thewh1teagle/vibe, a fascinating project that's right up our alley as software engineers. This tool, built with Rust


Getting Started with Chroma: A Deep Dive for Engineers

Let's break down why it's so useful and how you can get started with it.At its core, Chroma is a vector database. Think of it as a specialized database built to store and search for data based on its meaning rather than just keywords


Rust-Powered Desktop Apps from the Web: An Introduction to Pake

From a software engineer's perspective, Pake provides several key benefitsSpeed and Efficiency Instead of building a full-fledged desktop application from scratch with frameworks like Electron


PakePlus: Web to Desktop/Mobile in Minutes

PakePlus is a tool that allows us to package any webpage, or web applications built with frameworks like Vue or React, into lightweight native desktop and mobile applications


Rustfmt: The Essential Guide for Code Consistency and Productivity

rustfmt is the official code formatter for the Rust programming language. Its core purpose is to automatically reformat your Rust code according to a set of standardized style guidelines


The Software Engineer's Guide to Tauri: Small Bundles, Big Performance

Tauri is a framework that lets you build desktop applications using a web frontend (like HTML, CSS, and JavaScript, leveraging frameworks like React


Beyond grep: An Engineer's Guide to ast-grep

I'd be happy to explain what ast-grep is and how a software engineer can use it effectively.Imagine you want to find or change a specific pattern in your code