ashpd::desktop

Module background

Source
Expand description

Request to run in the background or started automatically when the user logs in.

Note This portal only works for sandboxed applications.

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

§Examples

use ashpd::desktop::background::Background;

async fn run() -> ashpd::Result<()> {
    let response = Background::request()
        .reason("Automatically fetch your latest mails")
        .auto_start(true)
        .command(&["geary"])
        .dbus_activatable(false)
        .send()
        .await?
        .response()?;

    println!("{}", response.auto_start());
    println!("{}", response.run_in_background());

    Ok(())
}

If no command is provided, the Exec line from the desktop file will be used.

Structs§