Script KWin window management (cascade, move, close, reload config) from the command line via D-Bus

domain: develop.kde.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Discover KWin's D-Bus object structure with qdbus org.kde.KWin /KWin (or qdbus6 on newer Plasma) to list available methods and signals
  2. Call built-in layout methods directly, e.g. qdbus org.kde.KWin /KWin cascadeDesktop or qdbus org.kde.KWin /KWin unclutterDesktop, for whole-desktop window arrangement
  3. Target or close a specific window via its D-Bus-exposed methods, such as killWindow, where supported, rather than relying on generic X11/Wayland window tools that don't understand KWin-specific state
  4. For automation beyond the built-in methods, write a KWin script (JS using the workspace and options globals), load and enable it, then trigger a reconfigure with qdbus org.kde.KWin /KWin reconfigure
  5. Re-run the introspection step after a Plasma upgrade before relying on a previously-working method name, since KWin's exposed D-Bus surface has changed across major Plasma versions

Known gotchas

Related routes

Script window placement and workspace switching from the command line with wmctrl
mankier.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans