Module settings

Source
Expand description

Read & listen to system settings changes.

use ashpd::desktop::settings::Settings;
use futures_util::StreamExt;

async fn run() -> ashpd::Result<()> {
    let proxy = Settings::new().await?;

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

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

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

    Ok(())
}

Structs§

Setting
A specific namespace.key = value setting.
Settings
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.

Enums§

ColorScheme
The system’s preferred color scheme
Contrast
The system’s preferred contrast level

Constants§

ACCENT_COLOR_SCHEME_KEY
Accent color key
APPEARANCE_NAMESPACE
Appearance namespace
COLOR_SCHEME_KEY
Color scheme key
CONTRAST_KEY
Contrast key

Type Aliases§

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