MCPcopy Index your code
hub / github.com/ayangweb/tauri-plugin-screenshots

github.com/ayangweb/tauri-plugin-screenshots @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
27 symbols 52 edges 13 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

tauri-plugin-screenshots

This plugin only works on tauri v2, if you need the v1 plugin, feel free to submit a PR!

Get screenshots of windows and monitors.

https://github.com/user-attachments/assets/0cc6e2ea-cf85-41ed-a809-078393a95c0f

Install

cargo add tauri-plugin-screenshots

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add tauri-plugin-screenshots-api

Usage

src-tauri/src/lib.rs

pub fn run() {
    tauri::Builder::default()
+       .plugin(tauri_plugin_screenshots::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

src-tauri/capabilities/default.json

{
    ...
    "permissions": [
        ...
+       "screenshots:default"
    ]
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import {
  getScreenshotableWindows,
  getWindowScreenshot,
} from "tauri-plugin-screenshots-api";

const windows = await getScreenshotableWindows();
const path = await getWindowScreenshot(windows[0].id);
console.log(path); // xx/tauri-plugin-screenshots/window-{id}.png

Methods

Method Description
getScreenshotableWindows Get all windows that can take screenshots.
getScreenshotableMonitors Get all monitors that can take screenshots.
getWindowScreenshot Get a screenshot of the window with the specified id.
getMonitorScreenshot Get a screenshot of the monitors with the specified id.
removeWindowScreenshot Remove locally stored window screenshots.
removeMonitorScreenshot Remove locally stored monitor screenshots.
clearScreenshots Remove all locally stored screenshots.

Example

git clone https://github.com/ayangweb/tauri-plugin-screenshots.git
pnpm install

pnpm build

cd examples/tauri-app

pnpm install

pnpm tauri dev

Thanks

  • Use xcap to get window and monitor screenshots.

Who's Using It?

  • Coco AI - Search, Connect, Collaborate, Your Personal AI Search and Assistant, all in one space.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 22
Interface 3
Class 2

Languages

Rust59%
TypeScript41%

Modules by API surface

src/commands.rs11 symbols
guest-js/index.ts9 symbols
examples/tauri-app/src/App.tsx2 symbols
src/lib.rs1 symbols
examples/tauri-app/src-tauri/src/main.rs1 symbols
examples/tauri-app/src-tauri/src/lib.rs1 symbols
examples/tauri-app/src-tauri/build.rs1 symbols
build.rs1 symbols

For agents

$ claude mcp add tauri-plugin-screenshots \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page