DSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it.
pip install display-server-interactions