Control the Niri Wayland compositor on Linux via its IPC (`niri msg --json` / $NIRI_SOCKET). Use when you need to query Niri state (outputs/workspaces/windows/focused window) or perform actions (focus/move/close windows, switch workspaces, spawn commands, reload config) from an OpenClaw agent running on a Niri session.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install niri-ipc或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install niri-ipc⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/niri-ipc/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: niri-ipc description: Control the Niri Wayland compositor on Linux via its IPC (niri msg --json / $NIRI_SOCKET). Use when you need to query Niri state (outputs/workspaces/windows/focused window) or perform actions (focus/move/close windows, switch workspaces, spawn commands, reload config) from an OpenClaw agent running on a Niri session. ---
Use Niri IPC through the niri msg CLI (preferred) or by writing JSON requests to $NIRI_SOCKET.
This skill assumes:
$NIRI_SOCKET is set (usually true inside the Niri session).Use the bundled helper script (wrapper around niri msg --json):
./skills/niri-ipc/scripts/niri.py version
./skills/niri-ipc/scripts/niri.py outputs
./skills/niri-ipc/scripts/niri.py workspaces
./skills/niri-ipc/scripts/niri.py windows
./skills/niri-ipc/scripts/niri.py focused-window
Use scripts/niri_ctl.py when you want to refer to windows by title/app_id substring instead of ids:
# List windows (optionally filtered)
./skills/niri-ipc/scripts/niri_ctl.py list-windows --query firefox
# Focus a window by substring match
./skills/niri-ipc/scripts/niri_ctl.py focus firefox
# Close a matched window (focus then close)
./skills/niri-ipc/scripts/niri_ctl.py close firefox
# Move a matched window to a workspace (by index or by name)
./skills/niri-ipc/scripts/niri_ctl.py move-to-workspace firefox 3
./skills/niri-ipc/scripts/niri_ctl.py move-to-workspace firefox web
# Focus a workspace by index or name
./skills/niri-ipc/scripts/niri_ctl.py focus-workspace 2
./skills/niri-ipc/scripts/niri_ctl.py focus-workspace web
Use scripts/niri_socket.py to talk to $NIRI_SOCKET directly (newline-delimited JSON):
# Send a simple request (JSON string)
./skills/niri-ipc/scripts/niri_socket.py raw '"FocusedWindow"'
# Batch requests: one JSON request per line on stdin
printf '%s\n' '"FocusedWindow"' '"Workspaces"' | ./skills/niri-ipc/scripts/niri_socket.py stdin
# Event stream (prints JSON events until interrupted)
./skills/niri-ipc/scripts/niri_socket.py event-stream
Pass through Niri actions:
# Focus workspace by index
./skills/niri-ipc/scripts/niri.py action focus-workspace 2
# Move focused window to workspace
./skills/niri-ipc/scripts/niri.py action move-window-to-workspace 3
# Focus a window by id
./skills/niri-ipc/scripts/niri.py action focus-window 123
# Close focused window
./skills/niri-ipc/scripts/niri.py action close-window
# Reload niri config
./skills/niri-ipc/scripts/niri.py action load-config-file
# Spawn (no shell)
./skills/niri-ipc/scripts/niri.py action spawn -- alacritty
# Spawn through shell
./skills/niri-ipc/scripts/niri.py action spawn-sh -- 'notify-send hello'
Use niri msg output ... via the wrapper:
./skills/niri-ipc/scripts/niri.py output --help
niri msgIf you don’t want the helper script, call Niri directly:
niri msg --json windows
niri msg --json action focus-workspace 2
Tip: if niri msg parsing errors happen after upgrades, restart the compositor (new niri msg against old compositor is a common mismatch).
For status bars/daemons: Niri can stream events.
# Raw JSON event lines (runs until interrupted)
./skills/niri-ipc/scripts/niri.py event-stream
# Just a few lines for a quick test
./skills/niri-ipc/scripts/niri.py event-stream --lines 5
./skills/niri-ipc/references/ipc.md.windows, then act by window id.安装 Niri IPC 后,可以对 AI 说这些话来触发它
Help me get started with Niri IPC
Explains what Niri IPC does, walks through the setup, and runs a quick demo based on your current project
Use Niri IPC to control the Niri Wayland compositor on Linux via its IPC (`niri msg...
Invokes Niri IPC with the right parameters and returns the result directly in the conversation
What can I do with Niri IPC in my developer & devops workflow?
Lists the top use cases for Niri IPC, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/niri-ipc/ 目录(个人级,所有项目可用),或 .claude/skills/niri-ipc/(项目级)。重启 AI 客户端后,用 /niri-ipc 主动调用,或让 AI 根据上下文自动发现并使用。
Niri IPC 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Niri IPC 可免费安装使用。请查阅仓库了解许可证信息。
Control the Niri Wayland compositor on Linux via its IPC (`niri msg --json` / $NIRI_SOCKET). Use when you need to query Niri state (outputs/workspaces/windows/focused window) or perform actions (focus/move/close windows, switch workspaces, spawn commands, reload config) from an OpenClaw agent running on a Niri session.
Niri IPC 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using Niri IPC
Identifies repetitive steps in your workflow and sets up Niri IPC to handle them automatically