Skip to main content

getactivewindow-x

Deprecated

maybe use pywinctl instead or one of the solutions in https://stackoverflow.com/q/10266281/5267751

See also https://github.com/Kalmat/PyWinCtl/issues/64

Separate component to get information on the active window in X.

Why?

In an attempt to be portable between operating systems.

The user can install another package that provides the same interface.

Important note

Use python-xlib fork https://github.com/fransklaver/python-xlib/tree/randr-errors-inherit-xerror to avoid hang.

pip uninstall python-xlib
pip install git+https://github.com/fransklaver/python-xlib.git@randr-errors-inherit-xerror

Internal details

There's another branch user202729/getactivewindow-x at spawn-xdotool-xprop-process that uses subprocess, xdotool and xprop.

API

Currently there are only these functions.

def active_window_id()->WindowID:
def window_name(window_id: WindowID)->str:
def window_class(window_id: WindowID)->tuple[str, ...]:

The window name should not (but may) change if the window ID is constant.

Packages should not rely on WindowID type being int.

Release files for getactivewindow-x 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getactivewindow-x 0.4.0
File Size Uploaded
getactivewindow_x-0.4.0.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for getactivewindow-x 0.4.0
File Interpreter ABI Platform
getactivewindow_x-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / getactivewindow_x-0.4.0.tar.gz

Download URL getactivewindow_x-0.4.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
edc437ebad35ce0039302c4115e7dfffa10d5a876c03a5eedfaca3c83e9448c0
BLAKE2b-256 checksum
How to use checksums
d08610fa57e5a0912b13424f75e76c47ad95c7fa0ff2dca26a788e1a9653acc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / getactivewindow_x-0.4.0-py3-none-any.whl

Download URL getactivewindow_x-0.4.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d0379b3bca94de0c37e10e6abf6087faeb7ef51660a558ee508c1bc919bd18e
BLAKE2b-256 checksum
How to use checksums
3aa0b5a02ddc0944870ad934bd36fe18bd86d841275150593b31a95902addf01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page