wmctrl
A tool to programmatically control windows inside X
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 wmctrluv
uv add wmctrlpoetry
poetry add wmctrlInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
PyWinBoxPyWinBox manages window positions, sizes, and…
permissive · top 15,000 on PyPI
EWMHlibQuery and control window managers that…
permissive · top 15,000 on PyPI
PyAutoGUIPyAutoGUI programmatically controls the mouse…
permissive · top 5,000 on PyPI
xlibProvides a pure-Python X11 client library for…
copyleft · top 15,000 on PyPI
pylnk3Reads, writes, and creates Windows .lnk…
copyleft · top 15,000 on PyPI
uiautomationAutomates Windows UI controls and windows by…
permissive · top 15,000 on PyPI
office-word-mcp-serverA Model Context Protocol server that exposes…
permissive · top 15,000 on PyPI
glfwPython bindings for GLFW 3 that wrap the C…
permissive · top 5,000 on PyPI