Module ashpd::desktop::screenshot[][src]

Expand description

Take a screenshot or pick a color.

Examples

Taking a screenshot

use ashpd::desktop::screenshot::ScreenshotProxy;

async fn run() -> Result<(), ashpd::Error> {
    let connection = zbus::azync::Connection::new_session().await?;

    let proxy = ScreenshotProxy::new(&connection).await?;
    let screenshot = proxy.screenshot(Default::default(), true, true).await?;

    println!("URI: {}", screenshot.uri());
    Ok(())
}

Picking a color

use ashpd::desktop::screenshot::ScreenshotProxy;

async fn run() -> Result<(), ashpd::Error> {
    let connection = zbus::azync::Connection::new_session().await?;

    let proxy = ScreenshotProxy::new(&connection).await?;
    let color = proxy.pick_color(Default::default()).await?;
    println!("({}, {}, {})", color.red(), color.green(), color.blue());

    Ok(())
}

Structs

Color

A response to a ScreenshotProxy::pick_color request. Note the values are normalized.

Screenshot

A response to a ScreenshotProxy::screenshot request.

ScreenshotProxy

The interface lets sandboxed applications request a screenshot.