DSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it. Currently, DSI only supports X11/Xorg (GNU/Linux) and Windows but it aims to be cross-platform.
WARNING: Please Do not use DSI in production, because it's currently in development!
Look at the documentation for moor information
fromdisplay_server_interactionsimportDSIdsi=DSI()
window=dsi.get_active_window()print("Active window: ")
print("\tName: {}".format(window.name))
print("\tPID: {}".format(window.pid))importcv2importnumpyasnpimg=np.array(window.get_image())
cv2.imshow(f'Screenshot of "{window.name}"', img)
whileTrue:
ifcv2.waitKey(1) &0xFF==ord('q'):
breakwindow.send_str("Hello World")window.warp_pointer(x=42, y=73)window.send_mouse_click(x=42, y=73)