Expand description
Wallpaper management via awww with cycling and theming support.
§Quick Start
use wayle_wallpaper::WallpaperService;
use std::path::PathBuf;
let wp = WallpaperService::new().await?;
// Set wallpaper on all monitors
wp.set_wallpaper(PathBuf::from("/path/to/image.jpg"), None).await?;
// Check current state
for (monitor, state) in wp.monitors.get().iter() {
println!("{}: {:?} (fit: {})", monitor, state.wallpaper, state.fit_mode);
}§Directory Cycling
// Cycle through a directory
wp.start_cycling(
PathBuf::from("/path/to/wallpapers"),
Duration::from_secs(300),
CyclingMode::Sequential,
)?;
// Manual navigation
wp.advance_cycle().await?;
wp.rewind_cycle().await?;
wp.stop_cycling();§Configuration
| Method | Effect |
|---|---|
transition(TransitionConfig) | Animation when changing wallpapers |
color_extractor(ColorExtractorConfig) | Tool and parameters for extracting dominant colors |
theming_monitor(Option<String>) | Which monitor drives color extraction |
shared_cycle(bool) | Sync cycling across monitors in shuffle mode |
engine_active(bool) | Toggle awww rendering (state tracking continues) |
use wayle_wallpaper::{WallpaperService, TransitionConfig, TransitionType};
let wp = WallpaperService::builder()
.transition(TransitionConfig {
transition_type: TransitionType::Left,
..Default::default()
})
.build()
.await?;§Reactive Properties
All fields are Property<T>:
.get()- Current value snapshot.watch()- Stream yielding on changes
§Service Fields
| Field | Type | Description |
|---|---|---|
cycling | Option<CyclingConfig> | Active cycling state |
monitors | HashMap<String, MonitorState> | Per-monitor wallpaper and fit mode |
transition | TransitionConfig | Animation settings |
§Control Methods
set_wallpaper()- Apply wallpaper to one or all monitorsstart_cycling()/stop_cycling()- Directory cyclingadvance_cycle()/rewind_cycle()- Manual navigationset_fit_mode()- Change scaling mode per monitor or globallyset_transition()- Configure animations
§D-Bus Interface
When with_daemon() is enabled, the service registers on the session bus.
- Service:
com.wayle.Wallpaper1 - Path:
/com/wayle/Wallpaper - Interface:
com.wayle.Wallpaper1
See dbus.md for the full interface specification.
Re-exports§
pub use error::Error;pub use types::ColorExtractor;pub use types::ColorExtractorConfig;pub use types::CyclingConfig;pub use types::CyclingMode;pub use types::FitMode;pub use types::MonitorState;
Modules§
Structs§
- Bezier
Curve - Bezier curve control points for transition easing.
- Position
- Position for Grow/Outer transitions as percentage of screen dimensions.
- Transition
Angle - Transition angle in degrees (0=right-to-left, 90=top-to-bottom).
- Transition
Config - Configuration for wallpaper transitions.
- Transition
Duration - Transition animation duration in seconds.
- Transition
Fps - Transition animation frame rate.
- Transition
Step - How much RGB values change per frame (1-255).
- Wallpaper
Proxy - D-Bus client proxy for controlling the wallpaper service.
- Wallpaper
Service - Desktop wallpaper manager. See crate-level docs for usage.
- Wallpaper
Service Builder - Builder for configuring a WallpaperService.
- Wave
Dimensions - Wave dimensions for the Wave transition effect.
Enums§
- Transition
Type - Transition animation type with its type-specific parameters.
Constants§
- SERVICE_
NAME - D-Bus service name.
- SERVICE_
PATH - D-Bus object path.