logo
Expand description

Request access to specific devices such as camera, speakers or microphone. Note This portal doesn’t work for sandboxed applications.

Examples

Access a Device

use ashpd::desktop::device::{Device, DeviceProxy};

async fn run() -> ashpd::Result<()> {
    let connection = zbus::Connection::session().await?;
    let proxy = DeviceProxy::new(&connection).await?;
    proxy.access_device(6879, &[Device::Speakers]).await?;
    Ok(())
}

Structs

The interface lets services ask if an application should get access to devices such as microphones, speakers or cameras. Not a portal in the strict sense, since the API is not directly accessible to applications inside the sandbox.

Enums

The possible device to request access to.