logo
Expand description

Request running an application in the background. Note This portal only works for sandboxed applications.

Examples

use ashpd::desktop::background;
use ashpd::WindowIdentifier;

async fn run() -> ashpd::Result<()> {
    let response = background::request(
        &WindowIdentifier::default(),
        "Automatically fetch your latest mails",
        true,
        Some(&["geary"]),
        false,
    )
    .await?;

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

    Ok(())
}

If the None is provided as an argument for command_line, the Exec line from the desktop file will be used.

use ashpd::desktop::background;
use ashpd::WindowIdentifier;

async fn run() -> ashpd::Result<()> {
    let response = background::request(
        &WindowIdentifier::default(),
        "Automatically fetch your latest mails",
        true,
        None::<&[&str]>,
        false,
    )
    .await?;

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

    Ok(())
}

Structs

The interface lets sandboxed applications request that the application is allowed to run in the background or started automatically when the user logs in.

Functions