🌞 Auto-Theme for Unity – Let Your Editor Follow the Sun! 🌙
You've probably experienced it:
Your desktop switches to light mode during the day for better visibility as sunlight floods your room. Most apps follow suit—automatically adjusting to match your system theme.
But not all do…
Unity doesn’t.
Auto-Theme is your solution!
Automatically switch between light and dark modes in the Unity Editor based on the time of day. Set your preferred times, and let Auto-Theme handle the rest—so you can focus on creating, not tweaking settings.
Make the Unity Editor match your day. Auto Theme switches Light/Dark by schedule, matching your OS, or manual overrides—with a one‑click toolbar toggle.
🔧 Key Features
- ⚡ Force Light / Force Dark — instant override
- 🕒 4 Modes Schedule — set Dark/Light start times (HH:mm), midnight wrap supported
- 🖥️ Match System — follow Windows/macOS/GNOME/KDE system theme
- 🧭 Toolbar Button — top‑right flat icon, cycles modes with a click
- 👤 Per‑User Settings — saved in EditorPrefs; no project assets modified
- 🚀 Immediate Apply — changes apply instantly; background check every ~30s
- 🎛️ Clean UI — Preferences page under Edit → Preferences → Arawn → Auto Theme
Why It Helps
- Comfort: automatic Light/Dark reduces eye strain across long sessions.
- Consistency: Match System keeps Unity aligned with your desktop.
- Speed: toggle on the toolbar—no window diving.
What’s Included
- AutoTheme.cs (Editor‑only): runtime logic + Preferences UI + toolbar integration.
How It Works
- Determines desired skin from Mode.
- Writes UserSkin (0 Light / 1 Dark) and calls InternalEditorUtility.SwitchSkinAndRepaintAllViews().
- Polls about every 30 seconds; Preferences/toolbar changes apply immediately.
OS Theme Detection
- Windows: AppsUseLightTheme (HKCU\…\Personalize).
- macOS: defaults read -g AppleInterfaceStyle.
- Linux (GNOME/KDE): gsettings color-scheme / gtk-theme, KDE kdeglobals.
- If undetectable, falls back to Schedule.
Compatibility & Requirements
- Editor‑only. No runtime impact on builds.
- Platforms: Windows, macOS (untested), Linux (supports GNOME/KDE for OS matching, tested on Zorin OS and CachyOS with GNOME DE).
Installation
- Install through Unity Package Manager
- Open Edit → Preferences → Arawn → Auto Theme, choose Mode Or change via toolbar (Sun/Moon/Gear Icon in the upper right corner)
- (Schedule) Enter times in HH:mm (24‑hour).