Module ashpd::desktop::screenshot

source ·
Expand description

Take a screenshot or pick a color.

Wrapper of the DBus interface: org.freedesktop.portal.Screenshot.

§Examples

§Taking a screenshot

use ashpd::desktop::screenshot::Screenshot;

async fn run() -> ashpd::Result<()> {
    let response = Screenshot::request()
        .interactive(true)
        .modal(true)
        .send()
        .await?
        .response()?;
    println!("URI: {}", response.uri());
    Ok(())
}

§Picking a color

use ashpd::desktop::Color;

async fn run() -> ashpd::Result<()> {
    let color = Color::pick().send().await?.response()?;
    println!("({}, {}, {})", color.red(), color.green(), color.blue());

    Ok(())
}

Structs§