Skip to main content

Crate wayle_wallpaper

Crate wayle_wallpaper 

Source
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

MethodEffect
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

FieldTypeDescription
cyclingOption<CyclingConfig>Active cycling state
monitorsHashMap<String, MonitorState>Per-monitor wallpaper and fit mode
transitionTransitionConfigAnimation settings

§Control Methods

  • set_wallpaper() - Apply wallpaper to one or all monitors
  • start_cycling() / stop_cycling() - Directory cycling
  • advance_cycle() / rewind_cycle() - Manual navigation
  • set_fit_mode() - Change scaling mode per monitor or globally
  • set_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§

error
Error types for the wallpaper service.
types
Domain types for the wallpaper service.

Structs§

BezierCurve
Bezier curve control points for transition easing.
Position
Position for Grow/Outer transitions as percentage of screen dimensions.
TransitionAngle
Transition angle in degrees (0=right-to-left, 90=top-to-bottom).
TransitionConfig
Configuration for wallpaper transitions.
TransitionDuration
Transition animation duration in seconds.
TransitionFps
Transition animation frame rate.
TransitionStep
How much RGB values change per frame (1-255).
WallpaperProxy
D-Bus client proxy for controlling the wallpaper service.
WallpaperService
Desktop wallpaper manager. See crate-level docs for usage.
WallpaperServiceBuilder
Builder for configuring a WallpaperService.
WaveDimensions
Wave dimensions for the Wave transition effect.

Enums§

TransitionType
Transition animation type with its type-specific parameters.

Constants§

SERVICE_NAME
D-Bus service name.
SERVICE_PATH
D-Bus object path.