wayle-wallpaper 0.1.3

Wallpaper management with cycling and color extraction
Documentation

wayle-wallpaper

Wallpaper management with cycling and color extraction support.

Crates.io docs.rs License: MIT

Installation

cargo add wayle-wallpaper

Usage

use wayle_wallpaper::WallpaperService;
use futures::StreamExt;

async fn example() -> Result<(), wayle_wallpaper::Error> {
    let wp = WallpaperService::new().await?;

    // Snapshot: show wallpaper on each monitor
    for (monitor, state) in wp.monitors.get().iter() {
        println!("{monitor}: {:?}", state.wallpaper);
    }

    // Watch: react to wallpaper changes for theming or logging
    let mut stream = wp.monitors.watch();
    while let Some(monitors) = stream.next().await {
        for (monitor, state) in monitors.iter() {
            println!("{monitor} wallpaper changed to {:?}", state.wallpaper);
        }
    }
    Ok(())
}

License

MIT

Part of wayle-services.