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§
- A specific
namespace.key = value
setting. - 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§
- The system’s preferred color scheme
- The system’s preferred contrast level
Constants§
- Accent color key
- Appearance namespace
- Color scheme key
- Contrast key
Type Aliases§
- A HashMap of the <key, value> settings found on a specific namespace.