Crate grim_rs

Crate grim_rs 

Source
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§

pub use error::Error;
pub use error::Result;
pub use geometry::Box;

Modules§

error
geometry

Structs§

CaptureParameters
Parameters for capturing a specific output.
CaptureResult
Result of a screenshot capture operation.
Grim
Main interface for taking screenshots.
MultiOutputCaptureResult
Result of capturing multiple outputs.
Output
Information about a display output.