Niri IPC for Openclaw

A comprehensive toolset to control the Niri Wayland compositor via IPC, enabling window management, workspace navigation, and event streaming.

atefr
v1.0.0
Feb 1, 2026
0
2.9k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install niri-ipc

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install niri-ipc using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Niri IPC?

The Niri IPC skill provides a powerful interface for interacting with the Niri Wayland compositor on Linux. By utilizing the native IPC mechanism ($NIRI_SOCKET) or provided Python helper scripts, this tool allows Openclaw Skills to programmatically query the state of your desktop environment and perform complex layout actions. It serves as a bridge between an AI agent and your Linux window manager, making it possible to automate GUI-related tasks through a structured command-line interface.

Whether you need to focus specific windows by their title, move applications between workspaces, or reload your configuration file, this skill simplifies the process. It abstracts raw JSON socket communication into easy-to-use commands, making it a vital component for developers and power users who want an agent-driven desktop experience.

Niri IPC Use Cases

  • Managing window layouts automatically based on the current project context.
  • Switching workspaces or focusing specific applications using natural language via an agent.
  • Monitoring window events to trigger automated responses or notifications.
  • Rapidly reloading compositor configurations during development or testing.
  • Spawning new terminal instances or GUI applications via IPC commands.

How Niri IPC Works

  1. The skill identifies the active Niri session by locating the $NIRI_SOCKET environment variable on the Linux system.
  2. Commands are issued either through the niri msg CLI tool or by writing newline-delimited JSON directly to the Unix socket.
  3. Python wrapper scripts like niri.py and niri_ctl.py parse the resulting JSON data to provide human-readable summaries or high-level filtering.
  4. The AI agent processes the structured output to decide on subsequent layout or window management actions.
  5. Continuous event streams can be opened to listen for real-time changes in the compositor state.

Niri IPC Setup

To use this skill within the Openclaw Skills framework, ensure you are running Niri on Linux. The $NIRI_SOCKET must be set in your environment.

# Test the connection to Niri
./skills/niri-ipc/scripts/niri.py version

# List all currently open windows
./skills/niri-ipc/scripts/niri.py windows

# Focus a workspace
./skills/niri-ipc/scripts/niri_ctl.py focus-workspace 1

Niri IPC Data Schema & Taxonomy

The skill utilizes JSON for all data exchange. Below is the organization of the primary data structures:

Category Data Fields
Outputs monitor name, resolution, focus state, and geometry.
Workspaces Index, name, visibility, and list of associated window IDs.
Windows ID, title, app_id, focus status, and floating state.
Events Streamed JSON objects indicating workspace switches or window creation.
Actions Success/Failure boolean responses for commands like spawn or close.

Niri IPC Advanced Features

  • Advanced window matching by substring for titles or app_ids using the niri_ctl.py helper.
  • Raw socket communication via niri_socket.py for high-performance batch processing or low-level debugging.
  • Real-time event streaming with configurable line limits for building custom status monitors.
  • Support for multi-agent workflows where one agent monitors the desktop state while another executes layout changes.
  • Integration with Openclaw Skills for complex automation of Wayland-based developer environments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*