Skip to content

Added: Add MediaProjection Screenshot API - #913

Open
involvex wants to merge 1 commit into
termux:masterfrom
involvex:feature/screenshot-api
Open

involvex wants to merge 1 commit into
termux:masterfrom
involvex:feature/screenshot-api

Conversation

@involvex

Copy link
Copy Markdown

Summary

  • Add ScreenshotAPI: MediaProjection consent dialog → capture display → write PNG
  • Wire api_method=Screenshot in TermuxApiReceiver
  • Register private translucent ScreenshotActivity

Default output path when file is omitted: \C:\Users\lukas/repos/screen-ocr/latest.png (overridable via --es file / CLI). Optional delay_ms waits after consent so the consent UI is not in the frame.

Companion CLI PR will target termux/termux-api-package (termux-screenshot).

Test plan

  • Build Termux:API and run termux-api Screenshot --es file /sdcard/shot.png
  • Deny consent → stdout ERROR: ...
  • Allow consent → PNG written, absolute path on stdout
  • delay_ms delays capture after consent

Made with Cursor

Capture the display via system MediaProjection consent and write a PNG for termux-screenshot and OCR workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant