ToggleTheme is a lightweight Windows system tray app that switches your system theme between Light and Dark mode. Nothing fancy, just switches themes.
It runs in the notification area, lets you toggle themes with a click, and keeps its menu label in sync when theme settings change externally.
I wrote it to quickly switch between themes while working on a new theme for my .NET apps. Maybe you could find a use for it too.
- Runs as a tray app (no main window)
- Left-click tray icon to toggle Light/Dark mode
- Right-click menu with:
Switch to Dark Mode/Switch to Light ModeAboutQuit
- Watches Windows theme registry keys and updates menu text automatically
- Writes logs to
%TEMP%\\toggletheme.log
ToggleTheme updates these Windows registry values under:
HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize
AppsUseLightThemeSystemUsesLightTheme
When either value changes, the app refreshes the tray menu label to reflect the current mode.
- Windows
- Go
1.26.4(fromgo.mod)
From the project root:
go mod tidy
go build -ldflags "-s -w -H=windowsgui" -trimpath -o toggletheme.exe./toggletheme.exeAfter launch, look for the tray icon in the Windows notification area.
If you update winres/winres.json, regenerate resources with:
go-winres make.
|- main.go
|- dark-theme.ico
|- go.mod
|- go.sum
|- go.work
|- winres/
| |- winres.json
|- rsrc_windows_386.syso
|- rsrc_windows_amd64.syso
- No tray icon appears: Ensure the app is running and check hidden icons in the taskbar overflow area.
- Theme does not switch: Verify your Windows personalization settings are not restricted by policy.
- Need diagnostics: Open
%TEMP%\\toggletheme.logfor startup and runtime logs.
This project is licensed under the MIT License. See LICENSE.