AutoDarkMode/Windows-Auto-Night-Mode
Automatically switches between the dark and light theme of Windows 10 and Windows 11
Mixed signals — read the receipts
worst of 4 axescopyleft license (GPL-3.0) — review compatibility; no tests detected
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 2d ago
- ✓16 active contributors
- ✓Distributed ownership (top contributor 41% of recent commits)
Show 4 more →Show less
- ✓GPL-3.0 licensed
- ✓CI configured
- ⚠GPL-3.0 is copyleft — check downstream compatibility
- ⚠No test directory detected
What would change the summary?
- →Use as dependency Concerns → Mixed if: relicense under MIT/Apache-2.0 (rare for established libs)
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/autodarkmode/windows-auto-night-mode)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/autodarkmode/windows-auto-night-mode on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: AutoDarkMode/Windows-Auto-Night-Mode
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/AutoDarkMode/Windows-Auto-Night-Mode shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Mixed signals — read the receipts
- Last commit 2d ago
- 16 active contributors
- Distributed ownership (top contributor 41% of recent commits)
- GPL-3.0 licensed
- CI configured
- ⚠ GPL-3.0 is copyleft — check downstream compatibility
- ⚠ No test directory detected
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live AutoDarkMode/Windows-Auto-Night-Mode
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/AutoDarkMode/Windows-Auto-Night-Mode.
What it runs against: a local clone of AutoDarkMode/Windows-Auto-Night-Mode — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in AutoDarkMode/Windows-Auto-Night-Mode | Confirms the artifact applies here, not a fork |
| 2 | License is still GPL-3.0 | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 32 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of AutoDarkMode/Windows-Auto-Night-Mode. If you don't
# have one yet, run these first:
#
# git clone https://github.com/AutoDarkMode/Windows-Auto-Night-Mode.git
# cd Windows-Auto-Night-Mode
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of AutoDarkMode/Windows-Auto-Night-Mode and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "AutoDarkMode/Windows-Auto-Night-Mode(\\.git)?\\b" \\
&& ok "origin remote is AutoDarkMode/Windows-Auto-Night-Mode" \\
|| miss "origin remote is not AutoDarkMode/Windows-Auto-Night-Mode (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(GPL-3\\.0)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"GPL-3\\.0\"" package.json 2>/dev/null) \\
&& ok "license is GPL-3.0" \\
|| miss "license drift — was GPL-3.0 at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "AutoDarkModeApp/App.xaml.cs" \\
&& ok "AutoDarkModeApp/App.xaml.cs" \\
|| miss "missing critical file: AutoDarkModeApp/App.xaml.cs"
test -f "AutoDarkModeApp/MainWindow.xaml" \\
&& ok "AutoDarkModeApp/MainWindow.xaml" \\
|| miss "missing critical file: AutoDarkModeApp/MainWindow.xaml"
test -f "AutoDarkModeApp/Services/LocalSettingsService.cs" \\
&& ok "AutoDarkModeApp/Services/LocalSettingsService.cs" \\
|| miss "missing critical file: AutoDarkModeApp/Services/LocalSettingsService.cs"
test -f "AutoDarkModeApp/Services/ActivationService.cs" \\
&& ok "AutoDarkModeApp/Services/ActivationService.cs" \\
|| miss "missing critical file: AutoDarkModeApp/Services/ActivationService.cs"
test -f "AutoDarkModeApp/Contracts/Services/IActivationService.cs" \\
&& ok "AutoDarkModeApp/Contracts/Services/IActivationService.cs" \\
|| miss "missing critical file: AutoDarkModeApp/Contracts/Services/IActivationService.cs"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 32 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~2d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/AutoDarkMode/Windows-Auto-Night-Mode"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Auto Dark Mode is a Windows 10/11 application that automatically switches between dark and light UI themes based on sunrise/sunset times or manual schedules. Written primarily in C# with a Rust-based downloader component, it also handles coordinated switching of wallpapers, cursor schemes, accent colors, and can execute custom scripts—solving the eye-strain problem of static theme choices across a full workday. Modular C# architecture: AutoDarkModeApp/ contains the main UWP/WinUI application with a clear Contracts/Services layer for dependency injection (IActivationService, IErrorService, INavigationService, IGeolocatorService). A separate Rust binary (adm-downloader-rs) handles update downloads and verification independently. Configuration appears file-based with geolocation data embedded as GeoJSON assets.
👥Who it's for
Windows users (10/11) who work indoors during varying daylight hours and want automatic theme switching without manual intervention; contributors to the project are typically C# desktop developers familiar with UWP/WinUI and system-level Windows APIs.
🌱Maturity & risk
Production-ready and actively maintained. The project is published on the Microsoft Store and supports multiple distribution channels (WinGet, Chocolatey, Scoop), suggesting significant real-world usage. Multiple GitHub workflow files (.github/workflows/) and issue templates indicate mature CI/CD and community processes. No signs of abandonment based on documented distribution and release infrastructure.
Low-to-moderate risk. The Rust downloader component (adm-downloader-rs) is relatively simple and dependency-light (reqwest, anyhow, sha2, windows crate), reducing supply-chain attack surface. Primary risk is tight coupling to Windows-specific APIs (Win32 System modules) which may break with major OS versions. Single maintainer presence noted in some contexts requires monitoring, but the Microsoft Store presence suggests some organizational backing.
Active areas of work
Active development with release infrastructure in place (GitHub Workflows, stale issue automation). The codebase shows recent publisher infrastructure maturity (Microsoft Store badge, multiple download channels documented). Specific current work is not visible from static file structure, but the presence of IActivationService and navigation contracts suggests ongoing UI/UX refinement for multi-page scenarios (Conditions, Hotkeys, Personalization, System areas pages shown in README).
🚀Get running
Clone the repository, open AutoDarkModeApp.csproj in Visual Studio 2022 (indicated by .vsconfig), restore NuGet packages, and build. For Rust component: cd into the Rust directory and run cargo build --release. The .editorconfig and .vsconfig ensure consistent IDE setup.
Daily commands:
Open AutoDarkModeApp/AutoDarkModeApp.csproj in Visual Studio 2022 (per .vsconfig), hit F5 to debug. For packaged distribution: build Release configuration and create AppX package via Visual Studio Package Creation wizard. The Rust downloader can be tested independently with cargo run --release from the Rust project root.
🗺️Map of the codebase
AutoDarkModeApp/App.xaml.cs— Main application entry point and initialization logic for the WinUI 3 desktop appAutoDarkModeApp/MainWindow.xaml— Root UI container and layout definition for the entire application interfaceAutoDarkModeApp/Services/LocalSettingsService.cs— Core service managing persisted configuration and application state across sessionsAutoDarkModeApp/Services/ActivationService.cs— Handles app activation, service initialization, and navigation on startupAutoDarkModeApp/Contracts/Services/IActivationService.cs— Interface contract defining the activation and initialization lifecycle contract.github/DEVELOPMENT_NOTE.md— Development guidelines and architectural decisions for contributors
🛠️How to make changes
Add a new application setting
- Add a new property to the data model class (
AutoDarkModeApp/Models/LocalSettingsOptions.cs) - Add getter/setter methods in the service to persist the setting (
AutoDarkModeApp/Services/LocalSettingsService.cs) - Add UI binding in your page's XAML markup (
AutoDarkModeApp/MainWindow.xaml) - Add localized display string to all language resource files (
AutoDarkModeApp/Strings/en-us/Resources.resw)
Add a new service
- Create an interface contract in Contracts/Services/ (
AutoDarkModeApp/Contracts/Services/IActivationService.cs) - Implement the service in Services/ folder following dependency injection pattern (
AutoDarkModeApp/Services/ActivationService.cs) - Register the service in ActivationService.cs or App.xaml.cs (
AutoDarkModeApp/Services/ActivationService.cs) - Inject the service interface into consuming pages or services via constructor (
AutoDarkModeApp/MainWindow.xaml.cs)
Add localization for a new language
- Create a new language subfolder under Strings/ (e.g., Strings/pt-br/) (
AutoDarkModeApp/Strings/en-us/Resources.resw) - Copy Resources.resw from en-us as a template (
AutoDarkModeApp/Strings/en-us/Resources.resw) - Translate all string values in the new Resources.resw file (
AutoDarkModeApp/Strings/en-us/Resources.resw) - Update the language helper to include the new culture code (
AutoDarkModeApp/Helpers/LanguageHelper.cs)
Add a new XAML value converter
- Create a new converter class in Helpers/ implementing IValueConverter (
AutoDarkModeApp/Helpers/EnumToBooleanConverter.cs) - Implement Convert() and ConvertBack() methods for data transformation (
AutoDarkModeApp/Helpers/EnumToBooleanConverter.cs) - Reference the converter in XAML markup using local: namespace binding (
AutoDarkModeApp/MainWindow.xaml)
🔧Why these technologies
- WinUI 3 — Modern XAML framework for Windows 10/11 native apps with fluent design system support
- C# with .NET — Native Windows development with strong type safety and access to Windows Runtime APIs
- MVVM/Dependency Injection — Testable, loosely-coupled architecture enabling service composition and UI separation
- Windows.UI.ViewManagement API — Direct access to Windows theme settings and system UI customization
- Rust Downloader (adm-downloader-rs) — Performance-critical update delivery with cryptographic validation (SHA2 verification)
- GeoJSON spatial data — Offline geolocation data for calculating sunset/sunrise without constant API calls
⚖️Trade-offs already made
-
Desktop WinUI 3 app instead of web or cross-platform
- Why: Requires direct OS-level theme API access that web apps cannot provide
- Consequence: Windows-only availability; stronger integration but narrower platform reach
-
Persistent local settings instead of cloud sync
- Why: Avoids authentication complexity and cloud dependencies; respects user privacy
- Consequence: Settings do not sync across devices; simpler deployment and data handling
-
Offline geospatial data (GeoJSON) instead of live API
- Why: Eliminates network latency and external service dependency for core scheduling logic
- Consequence: Geospatial data is static and requires manual updates; no real-time location tracking
-
Rust-based downloader for updates
- Why: Performance and security (SHA2 verification)
- Consequence: undefined
🪤Traps & gotchas
Windows API Specificity: The project heavily depends on Win32 APIs (Windows.Win32_System_* modules in Rust, implicit in C# through UWP framework). Changes in Windows 11 registry paths or theme schema may break theme detection. GeoJSON Loading: The app expects pre-bundled geolocation GeoJSON files; if these are outdated or malformed, location-based sunrise/sunset will fail silently. UWP Sandbox Constraints: Running as UWP may restrict direct registry access or file I/O for theme files; workarounds via broker services may be required. Rust Toolchain: The Rust downloader uses edition = '2024' (non-standard; likely typo for 2021) and static_vcruntime—ensure MSVC toolchain is installed. No visible test infrastructure: No Tests/ directory or *_test.cs files in the file list; manual testing or hidden test suites likely required before release.
🏗️Architecture
💡Concepts to learn
- Windows UWP (Universal Windows Platform) — The app is built on UWP with XAML UI layer; understanding UWP constraints (sandbox, app capabilities, lifecycle) is essential for modifying UI or system integration
- Win32 Registry API (Windows Registry Access) — Auto Dark Mode must read/write registry keys to switch Windows dark/light theme; direct Win32 interop is used in C# and Rust components
- Sunrise/Sunset Geolocation Calculation — Core feature relies on calculating solar events from user location using embedded GeoJSON; understanding the algorithm prevents scheduling bugs
- Dependency Injection (Service Locator Pattern via Contracts) — AutoDarkModeApp uses DI through Contracts/Services interfaces (IActivationService, INavigationService, etc.) for testability and loose coupling; essential for extending functionality
- XAML Data Binding & Converters — EnumToBooleanConverter and EnumToIndexConverter are examples of XAML markup extensions; required for mapping enum state (Dark/Light) to UI elements without code-behind coupling
- Cryptographic Hash Verification (SHA2) — Rust downloader uses sha2 crate to verify update integrity; critical for preventing man-in-the-middle attacks on binary distribution
- Windows Theme Files (.theme Format) — Feature supports switching complete .theme files (not just registry keys); these are structured text files defining wallpaper, cursor, colors; requires parsing and applying them programmatically
🔗Related repos
xkellsx/Dark-Mode-Toggle— Direct alternative Windows dark mode switcher; shows competing UI/approach in same ecosystemmicrosoft/terminal— Fellow Windows modern app using similar Contracts/Services DI pattern; reference architecture for UWP/WinUI best practicesfiles-community/Files— Modern Windows file manager also built on WinUI with similar theming concerns; shares ecosystem practices and may have solved related dark mode edge casesAutoDarkMode/AutoDarkModeWebsite— Official companion repo hosting documentation and web presence for this projectsitechtimes/dark-mode-toggle— Lightweight alternative theme switcher; useful for understanding minimal viable feature set for Windows theme automation
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add integration tests for the adm-downloader-rs Rust binary
The Rust downloader component (adm-downloader-rs) lacks visible test coverage. Given its critical role in downloading updates and verifying SHA2 checksums, adding integration tests would ensure reliability and prevent regressions. This is especially important since it handles cryptographic verification and file I/O.
- [ ] Create tests/ directory at the root of the adm-downloader-rs crate
- [ ] Add integration tests verifying SHA2 hash validation logic against known test vectors
- [ ] Add tests for file download simulation using mock HTTP responses with reqwest
- [ ] Add tests for Windows console output formatting (Win32_System_Console feature)
- [ ] Integrate tests into CI/CD pipeline via GitHub Actions workflow
Create GitHub Actions workflow for automated Rust binary builds and artifacts
The repo has a stale.yml workflow but no visible CI for building the Rust downloader binary (.github/workflows/). Given the multi-platform support (ARM64 and standard builds noted in PublishProfiles), automating Rust builds with matrix strategy for different architectures would ensure consistency and catch platform-specific issues early.
- [ ] Create .github/workflows/rust-build.yml with matrix strategy for x86_64 and ARM64
- [ ] Configure winres build-dependency to auto-generate Windows resource info
- [ ] Add artifact upload step to attach compiled binaries to releases
- [ ] Test both release (opt-level=3) and dev (opt-level=0) profile builds
- [ ] Document build output location and versioning in .github/DEVELOPMENT_NOTE.md
Add unit tests for XAML value converters in AutoDarkModeApp/Helpers/
The codebase contains 7 converter classes (EnumToBooleanConverter, EnumToIndexConverter, FlagsToVisibilityConverter, etc.) that handle UI binding logic but show no corresponding test files. These converters are critical for the UI to correctly display theme states, and unit tests would prevent binding bugs and improve maintainability.
- [ ] Create AutoDarkModeApp.Tests project (or Tests directory) with xUnit framework
- [ ] Add test class for each converter: EnumToBooleanConverterTests, EnumToIndexConverterTests, FlagsToVisibilityConverterTests, NullableBoolToBoolConverterTests, EnumToStretchConverterTests, EnumToVisibilityConverterTests
- [ ] Test edge cases: null values, invalid enum values, boundary conditions for index conversion
- [ ] Test FlagsToVisibilityConverter specifically with multiple flag combinations
- [ ] Reference test project in AutoDarkModeApp.csproj and add to CI pipeline
🌿Good first issues
- Add unit tests for EnumToBooleanConverter.cs and EnumToIndexConverter.cs in AutoDarkModeApp/Helpers/—these XAML converters are critical for UI binding but have no visible test coverage.
- Implement IErrorService in AutoDarkModeApp/Contracts/Services/—the interface exists but no implementation file is listed; create a service to centralize error handling and logging across the app.
- Create DEVELOPMENT.md documentation in .github/ explaining the geolocation GeoJSON data format and how to update ne_10m_admin_1_states_provinces.geojson and ne_50m_admin_0_countries.geojson when upstream sources change.
⭐Top contributors
Click to expand
Top contributors
- @Spiritreader — 41 commits
- @Armin2208 — 26 commits
- @weblate — 7 commits
- @turi1122 — 4 commits
- @Jay-o-Way — 4 commits
📝Recent commits
Click to expand
Recent commits
c83a142— Merge pull request #1218 from 20syldev/feature/powertoys-conflict-warning (Armin2208)b314840— Add PowerToys Light Switch conflict warning on Settings page (20syldev)38f9bd7— Modify exempt labels in stale.yml (Armin2208)59e24dc— Merge pull request #1181 from weblate/weblate-auto-dark-mode-app (Spiritreader)a55594e— Translated using Weblate (Chinese (Simplified Han script)) (大王叫我来巡山)16477d4— Translated using Weblate (Italian) (mapi68)6148386— Translated using Weblate (Hungarian) (turi1122)bc6e494— Merge pull request #1108 from weblate/weblate-auto-dark-mode-service (Spiritreader)9609334— Merge pull request #1110 from weblate/weblate-auto-dark-mode-app (Spiritreader)62701c4— Translated using Weblate (Hungarian) (turi1122)
🔒Security observations
The codebase demonstrates moderate security posture with no critical vulnerabilities identified. Primary concerns are configuration issues (invalid Rust edition), dependency management practices, and potential input validation gaps. The application appears to follow standard .NET/WinUI architectural patterns but would benefit from explicit security validation mechanisms and regular dependency audits. No hardcoded secrets, infrastructure misconfigurations, or obvious injection risks were detected in the provided file structure and manifests.
- Medium · Outdated Rust Edition in Cargo.toml —
Cargo.toml (adm-downloader-rs). The Cargo.toml specifies edition = '2024' which does not exist. Valid Rust editions are 2015, 2018, and 2021. This will cause build failures and indicates either a configuration error or placeholder value that wasn't updated. Fix: Update to a valid Rust edition: edition = '2021' for modern Rust tooling and features. - Low · Potential Dependency Vulnerability - reqwest —
Cargo.toml - dependencies section. The reqwest dependency (0.12) is pinned to a specific version. While this ensures reproducibility, it may miss security patches if a vulnerability is discovered. The blocking feature is used, which is less efficient than async for concurrent operations. Fix: Consider using version constraints like '0.12.*' to allow patch updates. Regularly audit dependencies using 'cargo audit' to identify and update vulnerable versions. - Low · Static VCRuntime Dependency —
Cargo.toml - build-dependencies. The static_vcruntime dependency (2.0) is used in build-dependencies. Static linking of the Visual C runtime can lead to larger binary sizes and potential version conflicts if the application interacts with other components expecting dynamic runtime linking. Fix: Evaluate whether static linking is necessary. Document the rationale for static linking and monitor for compatibility issues. - Low · No Cargo.lock in Repository —
Repository root. While the file structure shows dependencies, the presence of a Cargo.lock file is not evident in the provided structure. For binary applications, committing Cargo.lock ensures reproducible builds, but it appears to potentially be missing. Fix: Ensure Cargo.lock is committed to the repository for the Rust downloader component to guarantee consistent builds across environments. - Low · Geolocation Data in Bundle —
AutoDarkModeApp/Assets/Geo/. The application includes GeoJSON files (ne_10m_admin_1_states_provinces.geojson and ne_50m_admin_0_countries.geojson) in the assets. While these are public datasets, bundling large geographic datasets increases attack surface for potential data exfiltration or client-side processing vulnerabilities. Fix: Validate the necessity of bundled geographic data. If geolocation is required, consider loading from a trusted external source or implementing strict Content Security Policy controls. - Low · No Evidence of Input Validation Framework —
AutoDarkModeApp/Services/ and AutoDarkModeApp/Contracts/. The file structure shows Services and Contracts but no explicit input validation or sanitization patterns are evident. The application processes Windows API calls and geographic data which could be vulnerable to injection attacks if not properly validated. Fix: Implement comprehensive input validation for all user inputs and external data sources. Use established validation libraries and patterns appropriate for WinUI/Windows API calls.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.