Skip to main content

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

Project description

Display Server Interactions

PyPI version Documentation Status Downloads Supported Python Versions

License GitHub stars GitHub forks GitHub issues Publish

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!

Quick overview

Look at the documentation for moor information

Get a window

from display_server_interactions import DSI
dsi = DSI()
window = dsi.get_active_window()

Get basic window information

print("Active window: ")
print("\tName: {}".format(window.name))
print("\tPID: {}".format(window.pid))

Take a screenshot of the window

import cv2
import numpy as np

img = np.array(window.get_image())
cv2.imshow(f'Screenshot of "{window.name}"', img)

while True:
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

Sending keys to a window

window.send_str("Hello World")

Move the mouse pointer

window.warp_pointer(x=42, y=73)

Sending mouse clicks

window.send_mouse_click(x=42, y=73)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

display-server-interactions-0.0.dev11.tar.gz (18.4 kB view details)

Uploaded Source

File details

Details for the file display-server-interactions-0.0.dev11.tar.gz.

File metadata

File hashes

Hashes for display-server-interactions-0.0.dev11.tar.gz
Algorithm Hash digest
SHA256 663f066caff379c24939206a343421e2ac237295c7b68b8cf490f1cb84727f22
MD5 8ed6e0c7534c1cb0ff309555b16bc13e
BLAKE2b-256 e3b2b27276e7f148d439a703da6f11042cda3a416dd8ef827ff260ebcd3d1e3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page