sway-ipc

Control Sway window manager via swaymsg and IPC socket protocol.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/milojarow/dotfiles --skill sway-ipc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sway-ipc
Source: https://github.com/milojarow/dotfiles/tree/main/.claude/skills/sway-ipc
Command: npx skills add https://github.com/milojarow/dotfiles --skill sway-ipc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill allows for programmatic control, state querying, and event subscription for the Sway window manager, enabling advanced automation and customization.

Core Features & Use Cases

  • Runtime Control: Execute any sway command (e.g., change workspace, focus windows, toggle layouts).
  • State Querying: Retrieve detailed information about workspaces, outputs, windows, and input devices.
  • Event Subscription: React to real-time changes in Sway, such as window focus or workspace changes.
  • Use Case: Automatically switch to a specific workspace and launch an application when a certain event occurs, or create custom status bar information by querying Sway's state.

Quick Start

Use the sway-ipc skill to get a list of all current workspaces.

Frequently Asked Questions about sway-ipc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate window management tasks in Sway using IPC?

You can automate Sway window management by sending swaymsg commands or interacting directly with the IPC socket protocol to execute runtime commands, query system state, and subscribe to real-time window manager events.

Can I query the current Sway workspaces, outputs, and windows programmatically?

Yes, you can query detailed Sway state information programmatically by retrieving data on current workspaces, outputs, windows, and input devices through the IPC socket protocol and parsing the returned JSON message formats.

How do I react to real-time workspace or window focus changes in Wayland?

You can react to real-time changes in Wayland by using the Sway IPC protocol to subscribe to events like window focus or workspace changes, enabling dynamic automation and custom status bar updates based on the event stream.

Do I need to understand JSON parsing to use Sway IPC for scripting?

Yes, understanding JSON parsing and IPC message formats is required for advanced Sway scripting use cases, as the protocol returns detailed system state and event data in JSON format that your scripts must parse.

What is the best way to execute Sway commands like changing workspaces from a script?

The best way to execute Sway commands from a script is through runtime control via swaymsg or the IPC socket, allowing you to programmatically change workspaces, focus windows, and toggle layouts.

Does the sway-ipc skill work without any external dependencies?

Yes, the sway-ipc skill operates without external dependencies, relying solely on the built-in Sway IPC socket protocol and swaymsg to provide state querying, event subscription, and runtime control.