getactivewindow-x

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


Licenses
GPL-3.0/GPL-3.0+
Install
pip install getactivewindow-x==0.2.1

Documentation

getactivewindow-x

Deprecated

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

See also Kalmat/PyWinCtl#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.

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.