Separate component to get information on the active window in X.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file getactivewindow_x-0.4.0.tar.gz.
File metadata
- Download URL: getactivewindow_x-0.4.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc437ebad35ce0039302c4115e7dfffa10d5a876c03a5eedfaca3c83e9448c0
|
|
| MD5 |
b8885b7cccb440ad1084113b0d8ede12
|
|
| BLAKE2b-256 |
d08610fa57e5a0912b13424f75e76c47ad95c7fa0ff2dca26a788e1a9653acc6
|
File details
Details for the file getactivewindow_x-0.4.0-py3-none-any.whl.
File metadata
- Download URL: getactivewindow_x-0.4.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d0379b3bca94de0c37e10e6abf6087faeb7ef51660a558ee508c1bc919bd18e
|
|
| MD5 |
31917b83c043f93a428e7dbd68b7b8e9
|
|
| BLAKE2b-256 |
3aa0b5a02ddc0944870ad934bd36fe18bd86d841275150593b31a95902addf01
|