Skip to main content

Crate wallswitch

Crate wallswitch 

Source

Structs§

Arguments
Command line arguments
AuroraGenerator
Cosmic Aurora overlay generator.
AwwwBackend
CacheEntry
Represents cached information of a file to prevent re-hashing and re-probing
Config
Configuration variables
Dimension
Represents the physical dimensions (width and height) of an image.
Environment
Environment variables and system metadata.
FileInfo
Image information representing a wallpaper candidate.
FractalGenerator
Julia Fractal Generator and Image Post-Processor.
GnomeBackend
HyprlandBackend
Monitor
Monitor properties
OpenboxBackend
SliceDisplay
Star
Helper representation of individual stars in a Starfield.
StarfieldGenerator
Cyberpunk Starfield / Bokeh effect generator.
State
Manages the Wallpaper History and the Smart Cache
SwaybgBackend
XfceBackend

Enums§

Desktop
Represents the supported Desktop Environments (DE) or Window Managers (WM). We use an Enum instead of a String to ensure type safety and prevent logic errors.
DimensionError
Dimension Error enum definition
FileValidationError
Represents the explicit reasons why a candidate wallpaper file is invalid.
Orientation
Orientation: Horizontal or Vertical.
ProceduralEffect
Represents the supported procedural background overlay effects.
SortCriteria
WallSwitchError
WallSwitch Error enum

Constants§

CURSOR_TO_START
ERASE_LINE_TO_END

Traits§

Colors
ConcurrencyExt
Trait to provide hardware-aware concurrency helpers for collections.
DigitWidth
Extension trait to calculate the number of digits in an integer.
FileInfoExt
FloatIterExt
Find the maximum value of Vec<f64>.
IntegerIterExt
Find the maximum value of Vec<u32>.
PrintWithSpaces
Print Extension with Debug
RandomExt
Trait to extend slices with shuffling capabilities.
U8Extension
u8 Extension
WallpaperBackend
Core trait defining the wallpaper application logic. Follows the “Functional Core, Imperative Shell” pattern.

Functions§

compile_wallpapers_for_monitors
Pre-processes and compiles separate multi-picture composite backgrounds in parallel for each monitor.
compute_hashes_parallel
Computes the BLAKE3 hash of multiple files using a thread-safe parallel approach.
detect_monitors
Detects active outputs (monitors) using a robust fallback chain. Returns a WallSwitchResult wrapping a Vector of monitor property strings.
display_files
Display found images
exec_cmd
gather_files
Gather the files with Smart Caching and Visual Deduplication
get_active_xrandr_monitors
Get active X11 monitors via xrandr to filter out stale configurations.
get_awww_path
Get the ‘awww’ binary path, used by the generic Wayland backend.
get_config_path
Config file path: “/home/user_name/.config/wallswitch/wallswitch.json”
get_directories
Default directories to search for images
get_feh_path
Get the ‘feh’ binary path, used by the Openbox/X11 backend.
get_files_from_directory
Get all files into one vector.
get_hash
Calculates the BLAKE3 hash from any IO Reader stream.
get_images
Get unique and random images filtering against history
get_monitors
Get N monitors
get_random_integer
Generate a random integer value in the given range (min, max) inclusive.
get_random_integer_safe
Generate a random integer value in the given range (min, max) inclusive.
get_wallpaper_path
Default wallpaper path: “/home/user_name/wallswitch.jpg”
is_installed
Helper to check if a command exists in the system PATH.
kill_other_instances
Killing the previous instances of wallswitch before running
list_all_images
Displays images in a human-readable table format with sorting.
list_json_cache
Lists the internal state cache as a filtered JSON object.
parse_hyprland
Pure parser for Hyprland output
parse_niri
Pure parser for Niri output
parse_wlr_randr
Pure parser for wlr-randr output
parse_xfce
XFCE Logic: Matches active hardware (xrandr) with XFCE properties. If a monitor is active but has no XFCE property yet, we synthesize one.
parse_xrandr
probe_image_dimension
Probes image dimensions using pure-Rust in-process header scanning.
prune_stale_xfce_configs
rand
Generate random numbers without external dependencies.
read_config_file
Read config file path: “/home/user_name/.config/wallswitch/wallswitch.json”
run
Core application logic: coordinates arguments, state, and execution cycles.
set_wallpaper
Set desktop wallpaper based on the detected Desktop Environment.
show_initial_msgs
Show initial messages
update_images
Update FileInfo images with dimension information safely and concurrently.
where_is
Locate the exact absolute path for a system binary.

Type Aliases§

FileValidationResult
WallSwitchResult
Result type to simplify function signatures.