wallswitch/lib.rs
1/*
2
3src/
4├── backends/ # OS-Level Side Effects (Output & Hardware)
5│ ├── awww.rs # Wayland-specific transitions using the 'awww' daemon.
6│ ├── desktop.rs # Detection and identification of the current Desktop Environment.
7│ ├── detector.rs # Discovery of active physical outputs (X11, Wayland, or DRM monitors).
8│ ├── mod.rs # Module declaration and interface exports for OS backends.
9│ └── wallpaper.rs # Dispatcher logic to apply compiled backgrounds in-process and via backends.
10├── cli/ # User Interface Logic (Presentation Layer)
11│ ├── args.rs # CLI argument definitions, parsing, and shell completion generator.
12│ ├── list.rs # Formatted table/JSON display and sorting of image metadata.
13│ └── mod.rs # Module declaration and interface exports for CLI presentation.
14├── core/ # Pure Data Models & Business Logic (Domain Layer)
15│ ├── config.rs # Merges defaults, JSON config files, and CLI overrides into a single state.
16│ ├── dimension.rs # Image geometry logic: parsing, validating, and comparing resolutions.
17│ ├── fileinfo.rs # Core data structure for image metadata (paths, hashes, sizes, mtime).
18│ ├── mod.rs # Module declaration and interface exports for the core domain.
19│ ├── monitors.rs # Configuration for multi-monitor setups and output-specific settings.
20│ ├── orientation.rs # Enums and parsing for horizontal/vertical monitor layouts.
21│ └── state.rs # Manages persistent cache and history to prevent visual duplicates.
22├── effects/ # Sub-package containing all customizable mathematical overlays.
23│ ├── aurora.rs # Atmospheric Cosmic Aurora wave generator.
24│ ├── common.rs # Common mathematical helpers, coordinate viewports, and effect enums.
25│ ├── julia.rs # Julia Set fractal overlay generation and dynamic fitting.
26│ ├── mandelbrot.rs # Mandelbrot Set fractal overlay generation and density mapping.
27│ ├── mod.rs # Module declaration and interface exports for rendering overlays.
28│ ├── newton.rs # Newton-Raphson Basin fractal overlay generator and root optimization.
29│ ├── nova.rs # Nova Julia liquid fractal overlay generator and fluid dynamics.
30│ └── star.rs # Cosmic Starfield / Bokeh generator.
31├── sys/ # Low-Level System Integration (Input & Data Layer)
32│ ├── environment.rs # Safe access to OS environment variables ($HOME, $SESSION).
33│ ├── metadata.rs # Image metadata probing and BLAKE3 hashing.
34│ ├── mod.rs # Module declaration and interface exports for low-level OS operations.
35│ ├── pids.rs # Process management to detect and kill previous program instances.
36│ └── walkdir.rs # Recursive filesystem scanner optimized for image filtering.
37├── utils/ # Generic Tools & Helpers (Shared Utilities)
38│ ├── colors.rs # ANSI styling traits for colored and formatted terminal output.
39│ ├── complex.rs # Complex number structure, inline arithmetic, and scalar operations.
40│ ├── dependencies.rs # Pre-flight checks to verify required system binaries are installed.
41│ ├── mod.rs # Module declaration and interface exports for shared tools.
42│ ├── random.rs # Seedless randomization and Fisher-Yates shuffling algorithms.
43│ └── traits.rs # Reusable extensions for concurrency and numeric operations.
44├── app.rs # Application Heart: Orchestrates the main program flow and run cycles.
45├── error.rs # Error Handling: Centralized custom error types and error messages.
46├── lib.rs # Library Root: Organizes modules and defines public exports.
47└── main.rs # Entry Point: Minimal bootstrap that starts the app and handles fatal exits.
48
49*/
50
51// ==============================================================================
52// MODULE DECLARATIONS
53// ==============================================================================
54
55/// Orchestrates the core execution loops, quorum logic, and state management.
56pub mod app;
57
58/// Adapters for communicating with Desktop Environments, Window Managers, and Display Servers.
59pub mod backends;
60
61/// Adapters for user interaction, command-line arguments, and terminal output formatting.
62pub mod cli;
63
64/// The pure Domain of the application. Contains all business rules, entities, and validation.
65pub mod core;
66
67/// Sub-package containing all customizable mathematical overlays.
68mod effects;
69
70/// Global error definitions and centralized error handling logic.
71pub mod error;
72
73/// Adapters for interacting with the operating system (Filesystem, Processes, Environment).
74pub mod sys;
75
76/// Generic, domain-agnostic utilities and extension traits used across the application.
77pub mod utils;
78
79// ==============================================================================
80// PUBLIC EXPORTS (Facade Pattern)
81// ==============================================================================
82// By flattening the exports here, we allow the rest of the application (like main.rs)
83// to import items cleanly without needing to know the deep internal folder structure.
84// Example: `use wallswitch::Config;` instead of `use wallswitch::core::config::Config;`
85
86pub use self::{app::*, backends::*, cli::*, core::*, effects::*, error::*, sys::*, utils::*};