Skip to main content

Crate wallswitch

Crate wallswitch 

Source

Structs§

Arguments
Command line arguments
AwwwBackend
CacheEntry
Represents cached information of a file to prevent re-hashing and re-probing
Config
Configuration variables
Dimension
Dimension - width and length - of an image.
Environment
Environment variables and system metadata.
FileInfo
Image information
GnomeBackend
HyprlandBackend
Monitor
Monitor properties
OpenboxBackend
SliceDisplay
Implement fmt::Display for Slice [T]
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
Orientation
Orientation: Horizontal or Vertical.
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.
Countable
Trait for counting the number of chars
FileInfoExt
FileInfo Extension
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§

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_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
get_files_from_directory
Get all files into one vector.
get_hash
Calculates the BLAKE3 hash from Path.
get_images
Get unique and random images filtering against history
get_magick_path
Get the magick binary path
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
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
split_str
Split string into two numbers
update_images
Update FileInfo images with dimension information safely and concurrently.
where_is
Locate the binary path for a command

Type Aliases§

WallSwitchResult
Result type to simplify function signatures.