Introduction
In this tutorial, we'll explore how to set up and customize the Niri compositor, a modern tiling window manager that's gaining popularity as an alternative to traditional desktop environments. Niri offers a unique scrollable tiling experience that combines the efficiency of tiling window managers with intuitive navigation. We'll walk through installing Niri on a Linux system, configuring its core settings, and customizing it to match your workflow preferences.
Prerequisites
- A Linux system with X11 or Wayland support
- Basic knowledge of terminal commands
- Package manager access (apt for Ubuntu/Debian, pacman for Arch, etc.)
- Understanding of window manager concepts
Step-by-Step Instructions
1. Installing Niri on Your System
1.1 Check System Requirements
Before installing Niri, ensure your system meets the minimum requirements. Niri works best on systems with modern graphics drivers and supports both X11 and Wayland protocols.
uname -a
lsb_release -a
This command helps verify your system architecture and distribution details.
1.2 Install Dependencies
Niri requires several dependencies to function properly. Install them using your package manager:
# For Ubuntu/Debian systems
sudo apt update
sudo apt install libgl1 libglu1-mesa libxcb-cursor0 libxcb-xfixes0 libxcb-shape0 libxcb-randr0 libxcb-xinerama0 libxcb-xtest0 libxcb-xrm0 libxcb-xinput0 libxcb-xkb0 libxkbcommon-x11-0 libxkbcommon0 libwayland-dev libx11-dev libxext-dev libxfixes-dev libxrender-dev libxrandr-dev libxinerama-dev libxss-dev libxtst-dev libx11-xcb-dev libxkbcommon-x11-dev libxkbcommon-dev libx11-xcb-dev libx11-xcb-dev libx11-xcb-dev
1.3 Install Niri
Download and install Niri from its official repository:
git clone https://github.com/niriwm/niri.git
cd niri
cargo build --release
Building from source ensures you get the latest features and fixes. The release build optimizes performance for daily use.
2. Configuring Niri's Core Settings
2.1 Create Configuration Directory
Niri uses a configuration directory structure to manage settings:
mkdir -p ~/.config/niri
mkdir -p ~/.config/niri/config
This creates the necessary directory structure for Niri's configuration files.
2.2 Generate Default Configuration
Generate a default configuration file to begin customization:
niri --config ~/.config/niri/config/niri.ini
This command creates a default configuration file that you can modify to suit your preferences.
2.3 Configure Basic Settings
Edit the configuration file to set up basic parameters:
[core]
output = eDP-1
workspace_count = 4
This configuration sets up a single output display with four workspaces, which is ideal for most users.
3. Customizing the Niri Interface
3.1 Configure the Status Bar
Niri's status bar can display system information and workspace indicators:
[status_bar]
enabled = true
position = top
Positioning the status bar at the top provides easy access to system information without cluttering the workspace.
3.2 Set Up Workspace Navigation
Configure keyboard shortcuts for workspace switching:
[key_bindings]
workspace_1 = Mod1+1
workspace_2 = Mod1+2
workspace_3 = Mod1+3
workspace_4 = Mod1+4
Using Mod1 (Alt key) with number keys provides quick access to workspaces, making navigation efficient.
3.3 Configure Window Management
Set up how windows are tiled and managed:
[window_management]
tiling = true
focus_follows_mouse = false
Enabling tiling ensures windows are organized efficiently, while disabling focus follows mouse allows for more controlled window management.
4. Advanced Niri Features
4.1 Enable Scrollable Tiling
Niri's scrollable tiling feature allows you to navigate through windows using scroll gestures:
[scrollable_tiling]
enabled = true
scroll_sensitivity = 0.5
This feature makes window navigation more intuitive and efficient, especially when dealing with many open applications.
4.2 Set Up Custom Applications
Configure custom applications to launch on startup:
[startup]
applications = ["firefox", "thunderbird", "code"]
Automatically launching essential applications speeds up your workflow and ensures all necessary tools are available.
4.3 Configure Keyboard Shortcuts
Create custom keyboard shortcuts for frequently used actions:
[key_bindings]
open_terminal = Mod1+Return
open_launcher = Mod1+d
quit_niri = Mod1+Shift+q
These shortcuts provide quick access to essential functions without requiring mouse interaction.
5. Testing and Finalizing Your Setup
5.1 Restart Niri
After making all configuration changes, restart Niri to apply the settings:
niri --config ~/.config/niri/config/niri.ini
This command restarts Niri with your new configuration, allowing you to test all changes.
5.2 Verify Configuration
Check that all settings are working correctly by testing:
- Workspace switching with keyboard shortcuts
- Window tiling behavior
- Status bar visibility and functionality
- Application startup sequence
5.3 Troubleshooting Common Issues
If you encounter issues:
- Check configuration file syntax using
niri --config ~/.config/niri/config/niri.ini --validate - Ensure all required dependencies are installed
- Verify that your graphics drivers support Wayland
Summary
In this tutorial, we've walked through setting up and customizing Niri, a modern tiling window manager that offers a scrollable tiling experience. We've covered installation, basic configuration, interface customization, and advanced features. The key benefits of Niri include efficient window management, intuitive navigation through scrollable tiling, and customizable keyboard shortcuts that enhance productivity. By following these steps, you can transform your Linux desktop into a highly efficient workspace that combines the best of traditional window management with modern navigation techniques.



