Skip to main content

Module background

Module background 

Source
Available on crate feature background only.
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§

Background
The response of a BackgroundRequest request.
BackgroundProxy
The interface lets sandboxed applications request that the application is allowed to run in the background or started automatically when the user logs in.
BackgroundRequest
A builder-pattern type to construct Background.
BackgroundRequestOptions
Specified options for a BackgroundProxy::request_background request.
SetStatusOptions
Specified options for a BackgroundProxy::set_status request.