screenshot
Capture the focused monitor, a window, or a region on a Wayland desktop and return the image plus geometry/scale metadata for pixel-to-global mapping.
Instructions
Capture the focused monitor, a window (window: "active" or an
address from desktop, cheapest for reading one app), or a region
"x,y,WxH". Returns the image (or a file path to read) + JSON metadata
with geometry/scale for pixel→global mapping. A window on a hidden
workspace or under another window is still captured as itself
(metadata source "window"; without grim -T a shown window is cropped
from the screen, source "screen", and a hidden one is refused);
visible says whether the compositor draws it, and
a hidden one may show how it last looked (many apps stop drawing while
hidden). Window captures are refused while the session is locked. scale 0.1-1.0:
optional deliberate downscale, usually leave unset. stable=true
waits (up to 2s) until two consecutive frames match, so a capture
right after an action is not taken mid-animation; metadata gains
stable. Captures are fast JPEG by default; lossless=true returns
PNG for pixel-exact work. Before clicking a small control, follow with
zoom at the estimated point.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | ||
| region | No | ||
| stable | No | ||
| window | No | ||
| lossless | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |