$ show t1m0thyj/WinDynamicDesktop
WinDynamicDesktop is a Windows desktop application that replicates the macOS Mojave Dynamic Desktop feature, automatically changing the desktop wallpaper based on the time of day. Built with WinForms and .NET, it determines sunrise/sunset times using the device's location (via Windows location service or a geocoding API) and supports multiple monitors, lock screen synchronization, theme importing (from ZIP, JSON, or .ddw files), and localized translations across 50+ languages. The architecture includes a platform abstraction layer (DesktopHelper/UwpHelper for standard and UWP deployments), COM wrappers for wallpaper and power settings, SkiaSharp-based theme preview rendering, and an event-driven scheduler that responds to system events. It also features a PowerShell scripting interface for advanced customization, automatic updates via GitHub releases, and a config migration system for backward compatibility. The codebase is well-structured with clear separation of concerns, though it relies on external APIs (LocationIQ, POEditor) and Windows-specific COM interfaces, which introduce maintenance risk. The repository includes unit tests (sunrise calculations, system integration), CI/CD pipelines, and packaging scripts for installer and store distribution.
The LLM identified 4 files worth highlighting for reuse:
Implements a platform-specific helper for the standard Windows desktop environment, providing methods to set wallpapers, manage startup, update the lock screen, and handle updates. Alongside UwpHelper (which uses UWP APIs), it demonstrates a clean strategy pattern that can be extracted to support multiple deployment targets in any Windows desktop application. The abstraction isolates OS-specific calls behind a common interface, making the core logic platform-agnostic.
Provides a complete localization system using GNU gettext `.mo` files, including a `GetTranslation(string key)` function for static strings and a `TranslateForm(Form form)` method that automatically translates all UI elements on a WinForms form. The class integrates with POEditor for over-the-air translation updates and supports fallback to built-in resources. This pattern is reusable in any .NET application that requires dynamic language switching without recompilation.
Encapsulates the `IMultiMonitorDesktopWallpaper` COM interface, providing a managed wrapper to set different wallpapers on each monitor, retrieve display counts, and listen for display changes. The class handles COM initialization, resource cleanup, and error marshalling. This pattern is a safe, reusable component for any Windows application that needs to programmatically manage desktop wallpapers across multiple monitors without raw `DllImport` calls.
Implements a versioned migration path for user configuration stored in JSON format, supporting upgrades from v3 through v5 of the settings schema. Each migration step is isolated and idempotent, transforming old fields to the current structure while preserving user data. This pattern is reusable for any application that needs to maintain backward compatibility with older configuration files as the schema evolves.