skillfed

wmctrl

A tool to programmatically control windows inside X

wmctrl v0.5 207.0K downloads/30d#9,559 on PyPI12
Permissive license MIT DORMANT released

What it is and what it does

wmctrl is a Python wrapper around the X Window System's window management capabilities. It lets you programmatically interact with windows on X-based desktops—querying window lists, moving and resizing windows, and manipulating window properties—without manual GUI interaction. The package depends only on attrs and supports Python 2.7 and Python 3.8 through 3.12.

It is most useful in automation scripts, testing frameworks, and desktop tools that need to control or inspect window state. Because it targets X Window System specifically, it is not portable to Windows or macOS without a compatible X server. The dormant maintenance status reflects that the package is stable and feature-complete rather than actively developed, but it remains usable on systems where X11 is the window manager.

Use it for:

  • Automate window positioning and sizing in X11-based desktop testing or CI/CD pipelines.
  • Build desktop automation scripts that manage application windows programmatically.
  • Query and monitor active windows in X11 environments for system administration.
  • Integrate window control into Python-based window managers or tiling utilities.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

wmctrl provides programmatic control over windows in X Window System environments, allowing you to query, move, resize, and manage window properties from Python.

Yes, if you are working on X11-based systems and need programmatic window control. The low install friction, permissive MIT license, stable status, and zero known vulnerabilities make it a safe choice. However, it is only useful on X Window System environments; it will not work on Windows or macOS without an X server.

Install

wmctrl on PyPI

pip

pip install wmctrl

uv

uv add wmctrl

poetry

poetry add wmctrl

Installing wmctrl

Before you install

Low install friction with a single lightweight dependency (attrs). Maintenance is dormant—last release was 2023-09-16 and last commit 2024-09-03—but marked Production/Stable, suggesting the package is feature-complete rather than abandoned.

License in practice

MIT license is permissive; you can use, modify, and distribute wmctrl with minimal restrictions, making it safe for both open-source and commercial projects.

Quickstart

pip install wmctrl
import wmctrl
windows = wmctrl.Window.list()

Requires X Window System and the underlying wmctrl binary to be installed on the target system.

Verify before relying

  • Full scope of window management operations supported beyond basic query and manipulation.
  • Whether attrs is used only at install time or as a runtime dependency.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=2.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — attrs
Maintenance dormant — 1,063 days since the last release
Last repo commit
First released
Downloads 206,972/month — #9,559 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: wmctrl-0.5-py2.py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

X window manager controlprogrammatic window managementwmctrl python wrapperX11 window manipulationdesktop window automation
x11-desktopwindow-automation

More Utilities packages