mirror of
https://github.com/gabrielkheisa/auto_dark_light_windows.git
synced 2025-04-27 16:39:02 +07:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c0f53de986 | ||
|
da93884565 | ||
|
b02568fbea |
@ -92,10 +92,12 @@ This produces a GUI app (no console window).
|
||||
|
||||
---
|
||||
|
||||
## 🖼 Tray Preview
|
||||
## Tray Preview
|
||||
|
||||
You must provide your own `icon.ico` in the same folder — this will be used as the tray icon.
|
||||
|
||||

|
||||
|
||||
> Tip: You can create `.ico` files from PNGs using online converters like [icoconvert.com](https://icoconvert.com)
|
||||
|
||||
---
|
||||
@ -106,7 +108,7 @@ You must provide your own `icon.ico` in the same folder — this will be used as
|
||||
- Time check runs every 60 seconds
|
||||
- Changing the clock or timezone will trigger a switch automatically
|
||||
- No admin rights needed
|
||||
|
||||
- ~~⚠️ **Warning:** This program will kill and restart `explorer.exe` to ensure proper theme application after a mode switch. This is necessary because `explorer.exe` can sometimes become buggy and not fully apply the new theme, leaving behind visual artifacts. **Please ensure `explorer.exe` is not performing any sensitive tasks like copying files before a theme switch occurs, as this process will interrupt those operations.**~~
|
||||
---
|
||||
|
||||
## Optional Ideas
|
||||
@ -123,4 +125,4 @@ MIT — free for personal and commercial use.
|
||||
|
||||
---
|
||||
|
||||
Made with Go, Windows quirks, and coffee ☕
|
||||
Made with Go, Windows quirks, and Indocafe Coffeemix ☕
|
||||
|
4
main.go
4
main.go
@ -30,7 +30,7 @@ func setMode(light bool) {
|
||||
// Restart Explorer to fully apply theme
|
||||
func restartExplorer() {
|
||||
exec.Command("taskkill", "/f", "/im", "explorer.exe").Run()
|
||||
time.Sleep(1 * time.Second)
|
||||
time.Sleep(5 * time.Second)
|
||||
exec.Command("explorer.exe").Start()
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ func backgroundLoop() {
|
||||
|
||||
if newMode != lastMode {
|
||||
setMode(newMode == "light")
|
||||
restartExplorer()
|
||||
// restartExplorer()
|
||||
lastMode = newMode
|
||||
}
|
||||
|
||||
|
BIN
screenshot/tray.jpg
Normal file
BIN
screenshot/tray.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
x
Reference in New Issue
Block a user