pub struct Config {Show 23 fields
pub desktop: Desktop,
pub directories: Vec<PathBuf>,
pub extensions: Vec<String>,
pub interval: u64,
pub min_dimension: u64,
pub max_dimension: u64,
pub min_size: u64,
pub max_size: u64,
pub monitors: Vec<Monitor>,
pub monitor_orientation: Orientation,
pub once: bool,
pub path_feh: PathBuf,
pub sort: bool,
pub effect: ProceduralEffect,
pub effects: EffectsConfig,
pub wallpaper: PathBuf,
pub dry_run: bool,
pub transition_type: String,
pub transition_duration: u16,
pub transition_fps: u16,
pub transition_angle: u16,
pub transition_pos: String,
pub verbose: bool,
}Expand description
Configuration variables
Fields§
§desktop: DesktopDesktops: gnome, xfce, openbox, …
directories: Vec<PathBuf>Directories containing image files
extensions: Vec<String>Image file extension (identify -list format)
interval: u64Interval (in seconds) between each wallpaper displayed
min_dimension: u64Minimum dimension
max_dimension: u64Maximum dimension
min_size: u64Minimum file size
max_size: u64Maximum file size
monitors: Vec<Monitor>Monitor properties
monitor_orientation: OrientationAttach images to monitors in the Horizontal or Vertical orientation
once: boolRun a single wallpaper update cycle and exit
path_feh: PathBuffeh binary path
sort: boolSort the images found
effect: ProceduralEffectSelected procedural overlay effect (none, fractal, star, random)
effects: EffectsConfigConfigurable parameters and custom presets for mathematical overlays
wallpaper: PathBufWallpaper file path used by gnome desktop
dry_run: boolRun without actually applying wallpapers (Simulation mode)
transition_type: StringAnimation transition type for awww daemon
transition_duration: u16Duration of awww transition in seconds
transition_fps: u16Framerate of the awww transition animation
transition_angle: u16Angle for wipe/wave transitions
transition_pos: StringStarting position for center/outer transitions
verbose: boolShow intermediate runtime messages
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(args: &Arguments, env: &Environment<'_>) -> WallSwitchResult<Self>
pub fn new(args: &Arguments, env: &Environment<'_>) -> WallSwitchResult<Self>
Merges settings from the JSON configuration file with parsed command-line overrides.
§Errors
Returns a WallSwitchResult if config reading or validation fails.
Sourcepub fn default_with_env(env: &Environment<'_>) -> Self
pub fn default_with_env(env: &Environment<'_>) -> Self
Initializes a default configuration aligned with the active environment context.
Source§impl Config
impl Config
Sourcepub fn print(&self) -> WallSwitchResult<()>
pub fn print(&self) -> WallSwitchResult<()>
Print Config
Sourcepub fn validate_config(self) -> WallSwitchResult<Self>
pub fn validate_config(self) -> WallSwitchResult<Self>
Validate configuration
Sourcepub fn write_config_file(
self,
path: &Path,
read_default_config: bool,
) -> WallSwitchResult<Self>
pub fn write_config_file( self, path: &Path, read_default_config: bool, ) -> WallSwitchResult<Self>
Write config file path:: “/home/user_name/.config/wallswitch/wallswitch.json”
To ensure atomic write and protect against sudden crashes or interruptions, the configuration is written to a temporary file in the target directory and then renamed.
Sourcepub fn get_number_of_images(&self) -> usize
pub fn get_number_of_images(&self) -> usize
Get the number of images per cycle
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().