Module ashpd::desktop::settings[][src]

Expand description

Read & listen to system settings changes.

use ashpd::desktop::settings::SettingsProxy;

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

    println!(
        "{:#?}",
        proxy
            .read::<String>("org.gnome.desktop.interface", "clock-format")
            .await?
    );

    let settings = proxy.read_all(&["org.gnome.desktop.interface"]).await?;
    println!("{:#?}", settings);

    let setting = proxy.receive_setting_changed().await?;
    println!("{}", setting.namespace());
    println!("{}", setting.key());
    println!("{:#?}", setting.value());

    Ok(())
}

Structs

Setting

A specific namespace.key = value setting.

SettingsProxy

The interface provides read-only access to a small number of host settings required for toolkits similar to XSettings. It is not for general purpose settings.

Type Definitions

Namespace

A HashMap of the <key, value> settings found on a specific namespace.