A lightweight, cross-platform screenshot utility written in Rust.
shot captures screenshots and writes PNG or JPEG images to standard output, making it easy to save screenshots to files or pipe them into other commands.
- Capture a single monitor or all monitors.
- Select a monitor by index or name.
- Combine multiple monitors into one image while preserving their desktop positions.
- Output PNG or JPEG images directly to standard output.
- Support X11, Wayland, and Windows.
cargo install --git https://github.com/yutadev31/shotnix profile install github:yutadev31/shotshot > screenshot.pngWhen multiple monitors are connected, their screenshots are combined into a single image.
PNG is the default. Select JPEG with --format jpeg:
shot --format jpeg > screenshot.jpg--format png explicitly selects PNG. Both formats support monitor and region captures.
Select a monitor by its zero-based index:
shot --monitor 0 > screenshot.pngOr select it by name:
shot --monitor HDMI-A-1 > screenshot.pngThe short option -m is also available.
Use desktop coordinates in X,Y WIDTHxHEIGHT format (negative coordinates are supported):
shot --region "100,200 640x480" > screenshot.png
shot -r $(slurp) > screenshot.pngQuoted slurp output (shot -r "$(slurp)") is also supported. The region must
fit within the desktop image. --region cannot be combined with --monitor.
On Wayland, region coordinates use the compositor's logical desktop geometry
and require the xdg-output protocol. Each output is cropped at its own buffer
scale; images spanning different scales use the largest selected scale.
Use cpst to copy a screenshot directly to the system clipboard:
shot | cpyshot | tee screenshot.png | cpyNote: shot does not write image data directly to a terminal. Redirect or pipe its standard output.
| Platform | Backend | Status |
|---|---|---|
| Linux | Wayland | Supported |
| Linux | X11 | Supported |
| Windows | Win32 | Supported |
| macOS | — | Not supported |
On Wayland, the compositor must support at least one of the following screenshot protocols:
ext-image-copy-capture-v1wlr-screencopy-unstable-v1
On Windows, version 1703 or later of Windows 10 is required. Use Command Prompt or PowerShell 7.4 or later when redirecting PNG output.
Screenshot capture requires an active graphical desktop session.
Enter the Nix development environment:
nix developRun checks with Cargo:
cargo fmt --all --check
cargo clippy --all-targets --all-features -- -D warnings
cargo testBuild the release binary:
cargo build --releaseLicensed under the MIT License.