Module ashpd::flatpak[][src]

Expand description

Spawn commands outside the sandbox or monitor if the running application has received an update & install it.

Examples

Spawn a process outside of the sandbox, only works in a Flatpak.

use ashpd::flatpak::{FlatpakProxy, SpawnFlags, SpawnOptions};
use enumflags2::BitFlags;
use std::collections::HashMap;

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

    proxy
        .spawn(
            "contrast".into(),
            &[],
            HashMap::new(),
            HashMap::new(),
            SpawnFlags::ClearEnv | SpawnFlags::NoNetwork,
            SpawnOptions::default(),
        )
        .await?;

    Ok(())
}

Structs

FlatpakProxy

The interface exposes some interactions with Flatpak on the host to the sandbox. For example, it allows you to restart the applications or start a more sandboxed instance.

SpawnOptions

Specified options for a FlatpakProxy::spawn request.

UpdateInfo

A response containing the update information when an update is available.

UpdateMonitorProxy

The interface exposes some interactions with Flatpak on the host to the sandbox. For example, it allows you to restart the applications or start a more sandboxed instance.

UpdateProgress

A response of the update progress signal.

Enums

SandboxFlags

A bitmask representing the “permissions” of a newly created sandbox.

SpawnFlags

Flags affecting the created sandbox.

SupportsFlags

Flags marking what optional features are available.

UpdateStatus

The update status.