EWMHlib
Extended Window Manager Hints implementation in Python 3
What it is and what it does
EWMHlib wraps the Extended Window Manager Hints specification into Python classes that let you query and control X11 window managers without writing raw Xlib code. It provides two main entry points: EwmhRoot for desktop-level operations (active window, workspace management, WM protocols) and EwmhWindow for individual application windows (geometry, state, hints, events). The package also exposes lower-level functions and property constants for advanced use cases.
The library is built on python-xlib and works with EWMH-compliant window managers like GNOME (with X11), KDE, Cinnamon, and many tiling managers. It includes event-handling support for window changes and a Props class organizing all EWMH atoms and hints. However, it explicitly does not work with Wayland, the newer display server used by default in recent GNOME releases.
Use it for:
- Automate window positioning, resizing, or state changes (maximize, minimize, fullscreen) in X11 desktop environments
- Monitor active window changes and window events for automation or logging tools
- Query window properties (title, workspace, geometry, hints) for window management utilities
- Build desktop tools that need to interact with the window manager without low-level Xlib boilerplate
- Integrate window control into PyQt or Tkinter applications running on X11
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Query and control window managers that implement Extended Window Manager Hints (EWMH) standards, providing access to root and application window properties, hints, protocols, and events through python-xlib.
Yes, if you need to control or query EWMH-compliant window managers on X11. The low install friction, permissive license, and active maintenance make it a reasonable choice. However, do not install if you are targeting Wayland or non-X11 systems, or if you need a large community or extensive documentation—the package is small and Beta-stage.
Install
ewmhlib on PyPI
pip
pip install ewmhlibuv
uv add ewmhlibpoetry
poetry add ewmhlibInstalling EWMHlib
Before you install
Low friction install with only two runtime dependencies (typing-extensions and python-xlib). Actively maintained with recent commits; however, the package is in Beta status and has a small user base (161704 monthly downloads, position 10625).
License in practice
BSD 3 license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install ewmhlib
import ewmhlib
from ewmhlib import EwmhRoot, EwmhWindow
root = EwmhRoot()
active_window = root.getActiveWindow()
if active_window:
win = EwmhWindow(active_window)
Requires X11 display server; will not work on Wayland or non-X11 systems. python-xlib must be able to connect to an X display.
Verify before relying
- Exact Python version requirements (requires_python field is unspecified in metadata)
- Whether all EWMH-compliant window managers are equally well-supported or if some have known gaps
- Performance characteristics when handling many windows or frequent event polling
Package facts
| License | BSD 3 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — typing-extensions, python-xlib |
| Maintenance | actively maintained — 849 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 161,704/month — #10,625 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: EWMHlib-0.2-py3-none-any.whl
Keywords: ewmh, Extended-Window-manager-hints, window-manager, window, manager, hints
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
xlibProvides a pure-Python X11 client library for…
copyleft · top 15,000 on PyPI
PyWinBoxPyWinBox manages window positions, sizes, and…
permissive · top 15,000 on PyPI
python-xlibA pure-Python X11 client library that…
copyleft · top 5,000 on PyPI
wmctrlwmctrl provides programmatic control over…
permissive · top 15,000 on PyPI
glfwPython bindings for GLFW 3 that wrap the C…
permissive · top 5,000 on PyPI
PyGetWindowPyGetWindow provides functions to query,…
permissive · top 5,000 on PyPI
keysymdefProvides X11 and XF86 keysym definitions as…
unclear · top 15,000 on PyPI
screeninfoDetects and reports the location, dimensions,…
permissive · top 5,000 on PyPI
PyMonCtlPyMonCtl provides cross-platform Python access…
permissive · top 15,000 on PyPI