Thanks to visit codestin.com
Credit goes to github.com

Skip to content

user202729/getactivewindow-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages