skillfed

EWMHlib

Extended Window Manager Hints implementation in Python 3

ewmhlib v0.2 161.7K downloads/30d#10,625 on PyPI6
Permissive license BSD 3 Active released

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 ewmhlib

uv

uv add ewmhlib

poetry

poetry add ewmhlib

Installing 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

Development Status :: 4 - BetaEnvironment :: X11 ApplicationsIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.9

Tags

EWMH window manager controlX11 window hints pythonwindow manager queriesEWMH compliant window controlpython-xlib window propertiesX11 window events handlingwindow manager hints management
x11-desktopwindow-management

More Software Development packages