I remember trying to write a python script to control windows on KDE and could for the life of me not find the libraries, let alone APIs to call.
It's quite simple: when watching tournaments and other events that have multiple streams/stages, I have multiple windows streaming the content and different layouts.
- 1 full screen above every thing else when one stream has something important happening
- tiled: 2 windows 1x1, 3 windows 1x2, 4 windows 2x2, >4 windows 1 main with others on the side
- tiled with overlays: 1 main maximized and 1-2 overlayed windows above the main window in static places and a static size on the screen
I would like to be able to:
- initialise the script by selecting the windows by clicking on them
- define a main window
- define the overlay windows, their positions, and sizes
- apply the layouts as needed
It's not many API calls, but in python, without going down all the way to some X11 library, I haven't found a way to do it using KDE libraries.
There are other usecases for example switching between audio sinks with key strokes, updating window positions depending on which window has been opened and which activity is active, and a bunch of other stuff. Unless I write C++, or know where to find the library, or know how to bind to C++, or want to take the time to bind to C++ with FFI, I'm SOL.