Expand description
§grim-rs
A pure Rust implementation of the grim screenshot utility for Wayland.
This library provides a simple interface for taking screenshots on Wayland
compositors that support the wlr-screencopy protocol.
§Features
- Capture entire screen (all outputs)
- Capture specific output by name
- Capture specific region
- Capture multiple outputs with different parameters
- Save screenshots as PNG or JPEG
- Get screenshot data as PNG or JPEG bytes
§Example
use grim_rs::Grim;
use chrono::Local;
let mut grim = Grim::new()?;
let result = grim.capture_all()?;
// Generate timestamped filename (like grim-rs does by default)
let filename = format!("{}_grim.png", Local::now().format("%Y%m%d_%Hh%Mm%Ss"));
grim.save_png(result.data(), result.width(), result.height(), &filename)?;Re-exports§
Modules§
Structs§
- Capture
Parameters - Parameters for capturing a specific output.
- Capture
Result - Result of a screenshot capture operation.
- Grim
- Main interface for taking screenshots.
- Multi
Output Capture Result - Result of capturing multiple outputs.
- Output
- Information about a display output.