A lightweight, zero-dependency, fully reversible Scheduled Theme panel embedded directly inside Antigravity 2.0 Desktop (Windows) under Settings > Appearance.
Automatically switch Antigravity between your preferred Light and Dark themes on a daily schedule — without ever touching Windows system dark/light mode.
- Native UI inside
Settings > Appearance: Reuses Antigravity's own CSS variables (--background,--foreground,--border,--primary, etc.) so the Scheduled Theme card blends seamlessly in both Light and Dark modes (and custom presets). - Never modifies Windows OS theme: Only controls Antigravity's own theme state via its internal theme providers. All other Windows apps remain untouched.
- Custom Day / Night schedule: Configure daytime start (default
08:00) and nighttime start (default23:00), including cross-midnight intervals (23:00–08:00) and inverted schedules. - Per-slot theme presets: Choose either
Current Light/Dark Preset(mode-only switch, preserving your custom colors) or specific Antigravity presets (Default Light,Default Dark,Everforest,Nord,Catppuccin,Dracula,Tokyo Night,One Dark Pro,Solarized,Monokai,Gruvbox Material,Vesper, plus dynamically detected plugin presets). - Precision boundary scheduling & instant cold-start catch-up: Uses a single exact boundary
setTimeout(DST fall-back aware, with a 15-minute drift check and zero background timers when disabled) instead of constant 30-second polling, plus parallel config/provider startup binding and focus/visibility/sleep-wake catch-up — opening Antigravity at 02:00 AM immediately applies your Night theme. - Ultra-low runtime overhead: Decouples Settings page detection from mounted panel updates, uses narrow anchor-cached DOM probing and diff-based UI updates (zero full-page scans or redundant
<option>rebuilds during chat streaming), and encodes presets & scoped CSS compactly. - Manual Override Protection: Optional guard using expected-receipt matching (plus startup hydration grace protection) that detects when you manually switch themes via Antigravity's native controls and pauses auto-switching until the next scheduled boundary (displaying
Paused until HH:MM (manual override)with a one-click Resume schedule link). - Switch Now button: One-click manual flip between your configured Day and Night themes, coordinated with override protection.
- Zero external dependencies: Pure vanilla JavaScript runtime + pure Windows PowerShell scripts (no Node.js, Python, React toolchain, or
asarCLI required). - 100% reversible & atomic: Creates a byte-exact
resources\app.asar.bakbackup before patching, validates the temporary patched archive and.bakcleanliness before committing via same-volume atomicFile.Replace, and refuses to stack-patch or operate on truncated archives. Safe to re-run after Antigravity auto-updates.
- OS: Windows 10 / 11 (built-in Windows PowerShell 5.1 or PowerShell 7+)
- Target: Antigravity 2.0 Desktop installed under
%LOCALAPPDATA%\Programs\antigravity(or pass-InstallDir <path>)
- Close Antigravity Desktop completely (or pass
-ForceClose). - Open PowerShell in the repository root and run:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1If Antigravity is installed in a custom directory:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1 -InstallDir "D:\Path\To\Antigravity"- Launch Antigravity and open
Settings > Appearance. You will see the Scheduled Theme section embedded directly in the page.
Inspect whether the patch is active, not installed, or overwritten by a recent Antigravity update (read-only):
powershell -ExecutionPolicy Bypass -File .\scripts\status.ps1When Antigravity updates itself, its installer replaces resources\app.asar with the new version. Simply close Antigravity and re-run install.ps1:
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1The script automatically detects the new clean app.asar, refreshes resources\app.asar.bak with the new version's original binary, and re-applies the patch cleanly without duplicates. Your saved schedule and theme preferences are preserved automatically.
Close Antigravity and restore the original resources\app.asar byte-for-byte:
powershell -ExecutionPolicy Bypass -File .\scripts\uninstall.ps1To also remove your saved schedule configuration from %APPDATA%\antigravity\app_storage.json:
powershell -ExecutionPolicy Bypass -File .\scripts\uninstall.ps1 -CleanConfigantigravity-theme-timer/
├── src/
│ └── theme-timer.js # Vanilla JS runtime (DOM observer, scheduler, override guard, native UI)
├── scripts/
│ ├── install.ps1 # Auto-locate Antigravity, check process, .bak backup, idempotent ASAR patch
│ ├── uninstall.ps1 # Byte-exact rollback from .bak (+ optional -CleanConfig)
│ └── status.ps1 # Read-only status check (Installed / Not Installed / Overwritten)
├── docs/ # UI screenshots (light & dark mode)
├── README.md # English documentation
├── README_CN.md # Chinese documentation
├── LICENSE # MIT License
└── .gitignore
- Pure-PowerShell Atomic ASAR Patching:
install.ps1parses the Electronresources\app.asarheader once using fast.IndexOfAnyJSON span scanning, backs up the original file byte-for-byte toresources\app.asar.bak, encodessrc/theme-timer.jswith minimal valid JS string escaping (eliminating PowerShell 5.1ConvertTo-Jsonescape bloat), recalculates SHA-256 block integrity metadata, verifies the temporary archive before committing via same-volumeFile.Replace, and enforces strict truncation/clean-backup guards. - Scoped Main-World Injection: Non-target frames (SSH remote windows and embedded webviews) short-circuit before loading Electron APIs. Only local Antigravity Hub windows execute
src/theme-timer.jsviawebFrame.executeJavaScript. - Official Theme State Bridge & Low-Overhead UI:
theme-timer.jsruns authoritative config loading in parallel withO(1)-queue React Fiber discovery to bindSettingsSyncedStateProvider(themeModeProviderandcustomThemeSeedsProvider). Precision boundary timers and expected-receipt override detection keep themes synced even whenSettings > Appearanceis closed, while narrow.max-w-2xl/h3anchor caching and diff updates keep Settings UI rendering lightweight. - Port-Safe Persistence: Because Antigravity's local language server binds to an ephemeral
127.0.0.1port on every launch, configuration is persisted under the isolated namespace keyantigravity.themeTimer.v1inwindow.nativeStorage(%APPDATA%\antigravity\app_storage.json), mirrored tolocalStorageas a session cache.
- This is an unofficial community project and is not affiliated with or endorsed by Google.
install.ps1modifies onlydist/preload.jsinsideresources\app.asarafter creating a full byte-exact backup (resources\app.asar.bak). No other application binaries or Windows system settings are modified.- Future Antigravity updates may change internal frontend structures or enable Electron ASAR integrity fuses (
EnableEmbeddedAsarIntegrityValidation). If an update ever causes issues, run.\scripts\uninstall.ps1to immediately restore the clean application binary.

