From a79e6e433c1d9117a66455b2ea4f3f4247ea479a Mon Sep 17 00:00:00 2001 From: Ohidur Rahman Bappy Date: Fri, 8 Oct 2021 22:48:23 +0600 Subject: [PATCH] working --- .gitignore | 3 + assets/dark_mode.ico | Bin 0 -> 85182 bytes assets/light_mode.ico | Bin 0 -> 85182 bytes build.sh | 2 + go.mod | 8 ++ go.sum | 28 +++++++ icon.png | Bin 0 -> 4186 bytes main.go | 171 ++++++++++++++++++++++++++++++++++++++++++ readme.md | 19 +++++ 9 files changed, 231 insertions(+) create mode 100644 .gitignore create mode 100644 assets/dark_mode.ico create mode 100644 assets/light_mode.ico create mode 100644 build.sh create mode 100644 go.mod create mode 100644 go.sum create mode 100644 icon.png create mode 100644 main.go create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7963acb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.exe +*.syso +*.rar \ No newline at end of file diff --git a/assets/dark_mode.ico b/assets/dark_mode.ico new file mode 100644 index 0000000000000000000000000000000000000000..75afa8353cd36549523496df0e42395b3ae417a3 GIT binary patch literal 85182 zcmeI53A7wlna3+ULSk4FkR>3}4*^eL1TrAYz`(;fvIxTw-opXc31+VF6VzlwZ& zt>t;MX9xTip7+`&o>wl{_*qjYdEfcC=gmR}S&>*v=i+(Dxo)TipI`aUDkOard>cFt z-Ujc2C13&gM?mdOX?0S+1fBt7F?f^oAAzkvn5My;1O5!+%7)YLBi}Z_&~bc_uHiiG zKC3dLx}FT?0NJQreNU0+Ti{smMQ{!HA^0h1SN0b2d<0AahNkjC`acX> zm6so*_9m%L?aH5B&)NLLjU>m_zk+**H!oICRm{ZM?>+7vRnOV{13jRn|1RQw*lx|F ze2&C-K(lr{Px`LS3Wd@XzvltPL^Bx=kiHj~0^(>5ZYZ9f1w zYBSE%^40#zH|m2YfS&=i-{}1(KK~ZX0|$b&K@yT`r-DUbIT&k!*SYsU-~iCdPu%wD zulV~5Ap5qG8@;DCoe$OnakM8lo&?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H=kjO( literal 0 HcmV?d00001 diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..33c2190 --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +go-winres simply --icon icon.png --manifest gui +go build -ldflags -H=windowsgui \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..35dcac2 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module ohidur.com/windows-theme-switcher + +go 1.16 + +require ( + github.com/getlantern/systray v1.1.0 + golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c73a42f --- /dev/null +++ b/go.sum @@ -0,0 +1,28 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 h1:NRUJuo3v3WGC/g5YiyF790gut6oQr5f3FBI88Wv0dx4= +github.com/getlantern/context v0.0.0-20190109183933-c447772a6520/go.mod h1:L+mq6/vvYHKjCX2oez0CgEAJmbq1fbb/oNJIWQkBybY= +github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7 h1:6uJ+sZ/e03gkbqZ0kUG6mfKoqDb4XMAzMIwlajq19So= +github.com/getlantern/errors v0.0.0-20190325191628-abdb3e3e36f7/go.mod h1:l+xpFBrCtDLpK9qNjxs+cHU6+BAdlBaxHqikB6Lku3A= +github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7 h1:guBYzEaLz0Vfc/jv0czrr2z7qyzTOGC9hiQ0VC+hKjk= +github.com/getlantern/golog v0.0.0-20190830074920-4ef2e798c2d7/go.mod h1:zx/1xUUeYPy3Pcmet8OSXLbF47l+3y6hIPpyLWoR9oc= +github.com/getlantern/hex v0.0.0-20190417191902-c6586a6fe0b7 h1:micT5vkcr9tOVk1FiH8SWKID8ultN44Z+yzd2y/Vyb0= +github.com/getlantern/hex v0.0.0-20190417191902-c6586a6fe0b7/go.mod h1:dD3CgOrwlzca8ed61CsZouQS5h5jIzkK9ZWrTcf0s+o= +github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55 h1:XYzSdCbkzOC0FDNrgJqGRo8PCMFOBFL9py72DRs7bmc= +github.com/getlantern/hidden v0.0.0-20190325191715-f02dbb02be55/go.mod h1:6mmzY2kW1TOOrVy+r41Za2MxXM+hhqTtY3oBKd2AgFA= +github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f h1:wrYrQttPS8FHIRSlsrcuKazukx/xqO/PpLZzZXsF+EA= +github.com/getlantern/ops v0.0.0-20190325191751-d70cb0d6f85f/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA= +github.com/getlantern/systray v1.1.0 h1:U0wCEqseLi2ok1fE6b88gJklzriavPJixZysZPkZd/Y= +github.com/getlantern/systray v1.1.0/go.mod h1:AecygODWIsBquJCJFop8MEQcJbWFfw/1yWbVabNgpCM= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/icon.png b/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..acff72ad6bea63b0ef5ec3bbce9e4ebc17909314 GIT binary patch literal 4186 zcmV-g5T);lP)ozrUF`Z{DUAiAAY<5(=<7W?IvDW!g3s!w6WW!X^9sJ0b-S9 zY-3w!K|9jh_qn%!fItXIJV|fn&Rafzf#BWyf%|=TX71ei4IxcwZf>@^9eKBtOpCy2 z4uClvCwo7T2UNa>Abz!#WU(1?qSS^cDyEA0DUQt)5@fCeURg;J<}N`&NCXq*b)gc$hu_oO3$d(Y=N<{xtv(0I-X8ng9&I|AP2SQ7w9~ zdfvRSXrYmqHUQ1d%~p@Aa03V52B1u|PZH<{=+~TL|FU}a>`u`#LzpfA|J~i~bcXp> zBEAj4bkROK5CX?5Bx_Gqm6i^OmN88L-aL0s%~PF^gJV0=bKtLmfR>1Yit3V*evuxM z$j*nTYwda<&+2?196vz@3_bvGV4fPqlcGI@o<+aY(Q%v1q!&2ncZ>881t;7s+CfMF z8XLJ1DeBq|4d3B_O@xCPAdaYL2g3tU-_p4-Ds}A!aF@}2n+;C*H+y!vsbjxaC8koeS230XZ+s*%+RwRlM(~4PvUr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_b)RNqPd<9* zoo>-SBT0z>46*C&_h)e>wj&&k-RF-)W|;L7(r#5k4%PaOVv+x`reew4qJ73Ar2;UV zJtt1g(IWEps1{!rjKt=~;-iEveK(dXF8KM0T{`F=4LBGv@XiD zYR0trn#N|w883=6maoN`4FuBIrQ6g)_a=sFAjpy&mn4eHB!y%P4O$>~$g*@!Ch3?K kk>1#}=Jqa;|F&fE|CW2RUdDY<>i_@%07*qoM6N<$f|wibYXATM literal 0 HcmV?d00001 diff --git a/main.go b/main.go new file mode 100644 index 0000000..87f37ad --- /dev/null +++ b/main.go @@ -0,0 +1,171 @@ +package main + +import ( + "fmt" + "io/ioutil" + "log" + "strconv" + "syscall" + "time" + + "github.com/getlantern/systray" + "golang.org/x/sys/windows/registry" +) + +const ( + REGKEY = `Software\Microsoft\Windows\CurrentVersion\Themes\Personalize` // in HKCU + REGNAME_TASKBAR_TRAY = `SystemUsesLightTheme` + REGNAME_APP_LIGHT_THEME = `AppsUseLightTheme` +) + +func main() { + fmt.Println("Dark Mode on:", isDark()) + go monitor(react) + systray.Run(onReady, onExit) + +} + +func onReady() { + + if isDark() { + systray.SetIcon(getIcon("assets/light_mode.ico")) + } else { + systray.SetIcon(getIcon("assets/dark_mode.ico")) + } + + systray.SetTitle("Theme Switch") + systray.SetTooltip("Theme switcher") + + mLightMode := systray.AddMenuItem("Light Mode", "Switch to Light Mode") + mDarkMode := systray.AddMenuItem("Dark Mode", "Switch to Dark Mode") + mExit := systray.AddMenuItem("Exit", "Quit the program") + + go func() { + for { + select { + case <-mLightMode.ClickedCh: + fmt.Println("Set light mode") + setLightModeTheme() + case <-mDarkMode.ClickedCh: + fmt.Println("Set dark mode") + setDarkModeTheme() + case <-mExit.ClickedCh: + systray.Quit() + return + } + + } + }() + +} + +func onExit() { + systray.Quit() +} + +func getIcon(s string) []byte { + b, err := ioutil.ReadFile(s) + if err != nil { + fmt.Print(err) + } + return b +} + +// react to the change +func react(isDark bool) { + if isDark { + systray.SetIcon(getIcon("assets/light_mode.ico")) + + } else { + systray.SetIcon(getIcon("assets/dark_mode.ico")) + + } +} + +func isDark() bool { + k, err := registry.OpenKey(registry.CURRENT_USER, REGKEY, registry.QUERY_VALUE) + if err != nil { + log.Fatal(err) + } + defer k.Close() + val, _, err := k.GetIntegerValue(REGNAME_TASKBAR_TRAY) + if err != nil { + log.Fatal(err) + } + return val == 0 +} + +func setDarkModeTheme() { + setTheme(0) +} + +func setLightModeTheme() { + setTheme(1) +} + +func setTheme(themeMode uint32) { + k, err := registry.OpenKey(registry.CURRENT_USER, REGKEY, registry.QUERY_VALUE|registry.SET_VALUE) + if err != nil { + log.Fatal(err) + } + if err := k.SetDWordValue(REGNAME_TASKBAR_TRAY, themeMode); err != nil { + log.Fatal(err) + } + if err := k.Close(); err != nil { + log.Fatal(err) + } +} + +func monitor(fn func(bool)) { + var regNotifyChangeKeyValue *syscall.Proc + changed := make(chan bool) + + if advapi32, err := syscall.LoadDLL("Advapi32.dll"); err == nil { + if p, err := advapi32.FindProc("RegNotifyChangeKeyValue"); err == nil { + regNotifyChangeKeyValue = p + } else { + log.Fatal("Could not find function RegNotifyChangeKeyValue in Advapi32.dll") + } + } + if regNotifyChangeKeyValue != nil { + go func() { + k, err := registry.OpenKey(registry.CURRENT_USER, REGKEY, syscall.KEY_NOTIFY|registry.QUERY_VALUE) + if err != nil { + log.Fatal(err) + } + var wasDark uint64 + for { + regNotifyChangeKeyValue.Call(uintptr(k), 0, 0x00000001|0x00000004, 0, 0) + val, _, err := k.GetIntegerValue(REGNAME_TASKBAR_TRAY) + if err != nil { + log.Fatal(err) + } + if val != wasDark { + wasDark = val + changed <- val == 0 + } + } + }() + } + for { + val := <-changed + fn(val) + } + +} + +// auto dark mode light mode switch + +func getClockTime(tz string) string { + t := time.Now() + utc, _ := time.LoadLocation(tz) + + hour, min, sec := t.In(utc).Clock() + return ItoaTwoDigits(hour) + ":" + ItoaTwoDigits(min) + ":" + ItoaTwoDigits(sec) +} + +// ItoaTwoDigits time.Clock returns one digit on values, so we make sure to convert to two digits +func ItoaTwoDigits(i int) string { + b := "0" + strconv.Itoa(i) + return b[len(b)-2:] +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..8290a8b --- /dev/null +++ b/readme.md @@ -0,0 +1,19 @@ +## Windows theme switcher + +This program will appear on the system tray and help +switch the taskbar theme on windows. + + +Install the necessary dependencies + +``` +go install github.com/tc-hib/go-winres@latest +``` + + +To build run: + +``` +./build.sh +``` +