[][src]Module ashpd::flatpak

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 enumflags2::BitFlags;
use ashpd::flatpak::{FlatpakProxy, SpawnFlags, SpawnOptions};
use zbus::{fdo::Result, Connection};
use std::collections::HashMap;

fn main() -> Result<()> {
    let connection = Connection::new_session()?;
    let proxy = FlatpakProxy::new(&connection)?;

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

    Ok(())
}

Modules

update_monitor

Monitor if there's an update it and install it.

Structs

CreateMonitorOptions

Specficied options on a create monitor request.

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

Specficied options on a spawn request.

Enums

SandboxFlags

A bitmask representing the "permissions" of a newely created sandbox.

SpawnFlags

Flags affecting the created sandbox.

SupportsFlags

Flags marking what optional features are available.