-
Notifications
You must be signed in to change notification settings - Fork 1
/
TrayApp.go
240 lines (203 loc) · 25.6 KB
/
TrayApp.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package main
import (
"encoding/base64"
"fmt"
"os"
"os/exec"
"path/filepath"
"syscall"
"time"
"github.com/getlantern/systray"
"golang.org/x/sys/windows/registry"
)
var (
cmd *exec.Cmd
cmdCancel chan bool
dir string
startOnBoot bool
)
const (
SW_HIDE = 0
)
const (
// RegistryKey is the registry key where the startup information is stored
RegistryKey = `Software\Microsoft\Windows\CurrentVersion\Run`
// AppName is the name of the application used in the registry
AppName = "Mieru"
// ExecutableName is the name of the executable
ExecutableName = "mieru.exe"
)
func main() {
cmdCancel = make(chan bool)
// Get the current directory
var err error
dir, err = filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {
fmt.Println("Error getting current directory:", err)
return
}
// Load start-on-boot setting from registry
loadStartOnBoot()
// Run the commands when the program starts
runCommands()
// Initialize system tray
systray.Run(onReady, onExit)
}
func onReady() {
// Set the icon from base64 data
iconData := getTrayIcon()
systray.SetIcon(iconData)
systray.SetTooltip("Mieru is running")
// Create main menu items
optionsMenuItem := systray.AddMenuItem("Options", "")
startOnBootItem := optionsMenuItem.AddSubMenuItemCheckbox("Start on Boot", "Start the program automatically on system boot", startOnBoot)
openFolderMenuItem := optionsMenuItem.AddSubMenuItem("Open Folder", "Open the folder where the program is run from")
exitItem := systray.AddMenuItem("Exit", "Exit the program")
// Goroutine to handle menu item clicks
go func() {
for {
select {
case <-exitItem.ClickedCh:
stopCommand()
exitProgram()
case <-startOnBootItem.ClickedCh:
startOnBoot = !startOnBoot
saveStartOnBoot()
updateStartOnBoot(startOnBootItem)
case <-openFolderMenuItem.ClickedCh:
openFolder()
}
}
}()
}
func onExit() {
// Clean up resources
cmdCancel <- true
if cmd != nil && cmd.Process != nil {
cmd.Process.Kill()
}
}
func runCommands() {
// Build and run the first command: mieru.exe apply config config.json
cmd1 := exec.Command(filepath.Join(dir, ExecutableName), "apply", "config", "config.json")
cmd1.Dir = dir
// Hide the console window for the Go program
hideConsoleWindow(cmd1)
err := cmd1.Start()
if err != nil {
fmt.Println("Error running command 1:", err)
}
// Build and run the second command: mieru.exe start
cmd2 := exec.Command(filepath.Join(dir, ExecutableName), "start")
cmd2.Dir = dir
// Hide the console window for the Go program
hideConsoleWindow(cmd2)
// Run the second command asynchronously
go func() {
err := cmd2.Run()
if err != nil {
fmt.Println("Error running command 2:", err)
}
}()
// Wait for a short duration (adjust as needed)
time.Sleep(time.Second)
}
func exitProgram() {
systray.Quit()
}
func getTrayIcon() []byte {
// Base64-encoded icon data
iconBase64 := `AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJE5BTGPNAG9UiUAv1YjADIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfz8/BI0zAIWONQD7oV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AAAAAAAAAAAAAAAAAAAAAACONQC+jzQB/441Af/Fl3j/+vXv//vls//+tAL//rIB//6zAf//sgH//7IB//6zAP//sgD/+XQC//h1A//5dAP/+XUC//h0Av/5dQP/+HUF/+7Glv/s4cf/o4dm/1MkAf9TJAH/UyIBwQAAAAAAAAAAAAAAAAAAAAAAAAAAlTQANY81Af+ONQH/m0sc//fu6f/68+T//bod//+yAP//swH//7IB//+zAP/+swD//7IA//6zAP/4dQL/+HQC//l1Av/4dAL/+XUC//l1Av/4dAP/94Mb/+3cvv/o3MD/Zj0b/1IlAP9SJQH/VigEOAAAAAAAAAAAAAAAAAAAAACONAGWjzUA/441AP/Mo4n/+/Xv//zSdv//sgD//7MA//+yAf/+swD//7IA//+1Bf/8y1n//7MB//l1A//4dQP/+XUD//h0Av/4dQL/+HQC//l1Av/5dQL/86pn/+3gxv+sk3X/UiUB/1IlAf9TJACZAAAAAAAAAAAAAAAAAAAAAI41AOKONAH/kTgF//Pp3v/78+b//7YR//+zAP/+sgH//7IA//6zAP/+tQn/++Cn//r17//714X/+XQC//h1Av/5dAL/+XQC//h0Av/4dAP/+XUC//h1A//5fBH/7N/A/+LXuv9XKQb/UyQA/1IiAeQAAAAAAAAAAAAAAACLLgsWjzUA/440AP+mYDb/+/Tv//vhp//+swD//7MB//6zAP//swH//7cN//rls//79O7/+vXv//v07//zr23/+XUD//l1Av/4dQL/+HQC//l0Av/5dAP/+XUD//l0A//xwo//7OHG/3dQMP9TJAH/UiUB/1seABkAAAAAAAAAAJI2BS+ONQD/jjQB/7d8Wf/79O///NV7//+yAf//swH//7IA//25E//7573/+/Tu//rmvv/9xT7/+vDf/+3hxv/zrGn/+XQD//h0A//4dAP/+XQC//l0A//5dAP/+XUD//KsaP/t4Mb/jWpN/1IkAf9TJAD/WyMAMgAAAAAAAAAAkTIFM480Af+PNAH/uYBc//v17//80nP//7IB//6yAf//sgD/+uOv//r17v/65LX//7YN//6zAf/9wTD/7Nq6/+3gx//zqGL/+XQD//l1A//4dQL/+HUD//h1A//5dAL/8qpj/+3gxv+RcVD/UiUB/1IlAf9TIAA3AAAAAAAAAACRNwUzjjQB/481AP+4gFz/+/Xu//zTcv//swH//7IA//6zAf/8vyn/+tyZ//61CP//swH//7MB//6zAP/2jS7/7dy9/+zhxv/yplz/+HQD//l1A//5dAP/+XQD//l1Av/yq2P/7eDH/5BwUP9TJAD/UiQA/1MgBDcAAAAAAAAAAJE3BTOONAH/jzUA/7mBXP/69O7//NNz//6zAf//swD//7IB//+yAf/+swD//7MB//+yAf//sgD//7MB//l1A//2jzL/7dy+/+zgxv/zpVn/+XUD//l1A//4dAL/+XUC//KqYv/s4cf/kHFQ/1IkAP9SJQH/UyAENwAAAAAAAAAAkTIAM440Af+ONQH/uYBc//v07v/903P//rMB//6yAf/+sgH//rMB//6zAP//swH//rMA//6yAP//sgH/+XUD//h1A//0kDb/7N3A/+zgxf/1oFP/+HQC//l0Av/4dQL/86pj/+zgx/+QcFH/UyUA/1MlAP9TIAA3AAAAAAAAAACRNwAzjjQA/441Af+5gFz/+vTv//3Tcv//sgH//7MA//6yAf/+swD//rIB//+zAf/+sgH//7MB//+zAf/5dQP/+XUD//h0Av/0lTv/7N/A//G1d//4dAL/+XQC//l1Av/zqmP/7OHH/5FxUP9SJQH/UyQA/1MgBDcAAAAAAAAAAJE3ADOPNAH/jzUB/7mAXP/79O7//dJy//6yAP/+sgH//7MA//6zAP//sgH//rIA//+yAf/+swD//rMA//h1A//4dQP/+XQD//h0Av/2iSf/+HUD//l0A//4dQP/+HUD//OqYv/s4Mf/kXFQ/1MlAP9TJAH/UyUENwAAAAAAAAAAkTIAM480Af+PNAD/uYFd//v07v/803L//rIB//+yAP//sgD//7IB//+yAP//swH//rIA//+zAP//sgD/+HUD//l1Av/5dQP/+HUD//l1A//4dAL/+HUC//h0Av/5dQP/8qpi/+zgxv+QcVD/UiUB/1IlAf9TIAQ3AAAAAAAAAACRMgUzjzQB/480Af+4gV3/+/Xu//3Xgf/+swH//rMB//+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A//+yAf/+swD//rIA//h0A//5dAL/+XUC//l1Av/5dAP/+XQD//h1Av/5dAP/+HQC//h0A//5dQL/9JlF/+zfw//t4Mb/4NK2/2A0Ev9TJQH/UiUA/1IlAP9UIwGmTicTDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIwzBiiONQHljjUA/480Af+RNwD/y6CH//r17v/69O7/+9uS//6yAf/+sgH//7IA//+yAP/+sgH//rIB//6zAf//sgH//7MA//60Bf/+sgH//rMA//l0A//4dAP/+XQD//l1A//5dAP/+XQC//h1A//5dQL/+HUD//l1Av/5dQP/+HUF//C5fv/s4Mb/7eDG/6qRc/9VJQL/UiUA/1MkAf9SJQHnVyUGKQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI00AGqONAH+jzQB/441AP+fUyT/7NzQ//v17//67tX//L8o//+yAP/+swH//rMB//6yAf/+swH//rMB//6zAP/+sgH//LcN//vdmP/9xUH//rIA//h1Av/5dQP/+XQD//l1A//4dQL/+XUC//h1A//5dQP/+HQD//h0A//5dQL/+XUC//eGJP/t17L/7eDH/9jIrf9sQyH/UyUB/1MkAf9TJAD+VSUCbgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI80Ab2ONQD/jjUA/480Af+7g17/9u/n//r17//82pH//7cI//+zAP/+sgD//rIB//6zAf/+sgD//rMA//6yAf/8ux3/+uSz//r17v/76sn//cAw//h0A//4dAP/+HUC//l1Av/5dAP/+HQC//h1A//5dAP/+HQD//h1Av/4dAP/+HQC//h4Cv/xtnr/7ODE/+fawf+Sc1L/UiUC/1IkAf9TJQH/UyIAwQAAAAAAAAAAAAAAAAAAAAAAAAAAmTMZCo80APSPNQD/jzUB/5I9Cf/RqZH/+vXv//rz4v/8ylL//rIB//+yAP/+swH//rMB//+zAf/+sgH//7IA//28JP/74qz/+vXt//v17//69O7/++rG//aOM//5dAL/+XUD//h0Av/4dQP/+XQC//l0Av/5dQL/+XQC//h1A//5dQP/+HUD//h0A//1nEn/7Ny9/+zgxv+w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P//sgD//rIA//6zAP/+swD//rIB//65F//74q//++e4//y5Fv//swH//7MB//6yAP/+sgH//rIA//eEIf/uzaP/7eDE/+zhxv/vyZj/9oUe//l1Av/5dAP/+XQC//l1A//5dQL/+XQC//h0Av/5dQL/7s6k/+3hxv/cz7P/aT4c/1IlAf9TJQH/UiQA/1UhAlwAAAAAAAAAAAAAAAAAAAAAkTUAVo80Af+PNQH/jzUA/51OH//v4dX/+vXv//vnwf/+swD//7IA//+zAf//sgD//7IB//6yAf/9vCP//LkX//6zAP/+sgD//7IB//6yAP//swH//rIB//h0A//3jjD/786m/+3gxv/t4Mf/7saW//aGIv/5dAL/+HUD//h0A//4dQP/+XQD//l1A//5dAP/7s6l/+zgx//dzrL/aT8d/1MkAf9SJQD/UiUB/1UhAFwAAAAAAAAAAAAAAAAAAAAAkTUAVo40Af+ONAH/jjQB/51PH//v4NT/+vTu//rnwf//sgD//rIB//6yAP//swH//7MB//+yAf/+sgD//7MA//+yAf//sgD//rIA//6zAf//swD//rMA//h1A//5dAL/94kn/+zUsP/t4cf/7ODG/+7Knf/2hCH/+XQC//h1Av/4dAL/+HUC//l1A//4dAL/7s+k/+zhxv/dzrP/aD8c/1IkAP9TJQH/UiUB/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjUCVo81Af+PNAD/jjUB/5xPH//u4dX/+vXu//vnwP/+swH//rIA//6yAP//sgH//7MA//+zAP//sgH//rIB//+zAf//swD//rMA//6yAP/+sgD//rMA//h0A//5dAL/+XUD//eIKP/v06v/7eHF/+zhx//ww47/+YAb//h0A//4dAL/+HUC//h0Av/4dQL/78+k/+3gxv/czrL/aT4d/1IkAP9TJAD/UyQA/1UhAFwAAAAAAAAAAAAAAAAAAAAAkTIAVo40Af+ONQD/jzUA/5xPHv/u4dX/+/Tu//vnwf/+swH//rIB//+zAP/+sgD//7IB//+zAP/+sgD//rMB//+zAf//sgD//rIB//+zAf/+sgD//rIB//h1Av/5dAP/+HUD//l1Bf/1kjn/79Ks/+zhxv/s4MT/87Nz//h0A//5dQP/+XUC//h0Av/5dAP/786k/+3gx//czrL/aD8c/1MlAf9SJAH/UyQB/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjUCVo41AP+ONQH/jzUB/5xOHv/v4NT/+/Tv//rnwf/+swD//7IA//6yAP//swH//7MB//6yAf//swH//7IA//+yAP/+swD//7MB//+zAP//sgH//rMB//h0Av/4dQP/+XQD//h1A//4dQT/94wu/+zZuP/v06r/94wv//l1Av/5dQL/+HUD//h1Av/4dQL/7s+k/+zhx//dzrL/aD8d/1IlAf9TJQH/UiQB/1UhAlwAAAAAAAAAAAAAAAAAAAAAkTIAVo81Af+PNAD/jjUB/5xOH//u4NT/+vXu//rmwf/+sgD//rIA//+yAf//sgD//rIA//+zAP/+swH//7MB//+yAf//sgH//rIA//6zAf//swH//7MA//l1Av/5dAL/+HUC//h0Av/4dQP/+XUD//aJJ//2jzP/+HUD//l1A//4dQP/+HQD//l0Av/5dAL/78+k/+zhx//cz7L/aT8c/1IkAP9TJAH/UyUB/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjICVo81Af+ONQH/jjUB/5xPH//u4NX/+/Tu//rnwf/+sgH//7IB//6zAP/+sgD//rIB//+yAP/+swH//rIA//+zAP//sgD//rIA//+yAf/+swD//7MB//h1A//5dQL/+XQD//h0Av/5dQL/+XUD//l0A//5dAL/+HQD//h1A//5dAL/+HUC//h1Av/5dAP/7s6l/+zhxv/dzrL/aD8c/1MlAf9SJQD/UyUA/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjICVo40AP+ONAD/jjQA/51OHv/u4dX/+vTv//rmwP//sgD//7IB//+zAf//sgD//7MB//6yAf//sgD//rIA//6yAf//sgH//rIA//+zAP/+sgD//rMB//h1Av/4dAL/+XQD//l1Av/4dQP/+XQD//h0A//5dQP/+HQD//l1Av/4dAL/+XUD//l0A//4dQP/78+l/+3hxv/cz7L/aD4d/1MlAP9TJAH/UiQA/1UhAFwAAAAAAAAAAAAAAAAAAAAAkTICVo41Af+ONQD/jzQA/5xPH//v4dT/+/Xv//vow///tQT//rMB//6yAP/+swD//rIA//6zAf/+sgD//7IB//6yAP//sgD//7MB//6yAP/+sgH//7MA//l0Av/5dAL/+XQD//l1A//4dAP/+HQD//h1Av/4dQP/+HUD//l1A//5dAP/+XUC//l1A//4dwT/7s+n/+3hx//czrP/aT4d/1MkAP9SJAH/UyQB/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjUCVo41AP+PNQD/jjUB/51OH//v4dT/+/Xv//rw3P/8z2L//7YL//6yAP//sgD//rMB//+zAP/+swH//rMB//6yAP//sgD//7IA//6zAf//sgD//rIB//h0A//5dAP/+HQD//l0Av/4dQP/+XQC//h1A//5dAP/+HQD//l1A//5dAL/+XUC//h5Cv/zolT/7Nu4/+3gx//czrP/aT4c/1IkAP9TJAD/UyQB/1UhAFwAAAAAAAAAAAAAAAAAAAAAjjICVo40Af+ONAD/jjQB/5lJF//jzL3/+/Tv//r07v/68uX/+uCi//y4FP//sgD//rMB//6yAP//sgD//7MB//6yAP/+sgH//7IA//6yAP//sgH//rIA//h1A//5dQL/+HQD//h1Av/4dAL/+XQD//h0Av/5dAL/+HQD//h0Av/4dQP/+X8U//HBi//t3Lz/7ODG/+zgxv/OvaD/YzcV/1IlAP9TJAH/UiUB/1UhAlwAAAAAAAAAAAAAAAAAAAAAjjUCVo40AP+PNAH/jjQB/440AP+dTh7/2Lmk//bs5P/79O//+/Xu//vt0f/8x0b//rQH//6zAP//sgD//7IA//+zAf/+sgD//7MB//+yAP/+sgD//rIA//h0Av/4dQL/+HQD//l0A//5dAP/+XUC//l1A//4dAP/+XUD//h5CP/0lj//7tWu/+zgxv/t4cf/59q+/7+rjf9oPhz/UyQA/1MkAf9TJAD/UiUA/1UhAFwAAAAAAAAAAAAAAAAAAAAAjzMAQI80APWPNQH/jjQA/440AP+ONAD/kjwI/7uEY//o1sj/+vTu//r17v/77tz//NeC//zAMP/9vyz//L4t//2/LP/8viz//b8s//2/LP/8vy3//b4t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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==`
// Decode the base64 data
iconData, err := base64.StdEncoding.DecodeString(iconBase64)
if err != nil {
fmt.Println("Error decoding icon data:", err)
return nil
}
return iconData
}
// hideConsoleWindow hides the console window for the Go program on Windows
func hideConsoleWindow(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
}
func stopCommand() {
// Build and run the stop command: mieru.exe stop
cmdStop := exec.Command(filepath.Join(dir, ExecutableName), "stop")
cmdStop.Dir = dir
// Hide the console window for the Go program
hideConsoleWindow(cmdStop)
err := cmdStop.Run()
if err != nil {
fmt.Println("Error running stop command:", err)
}
}
func openFolder() {
err := exec.Command("explorer", dir).Start()
if err != nil {
fmt.Println("Error opening folder:", err)
}
}
func loadStartOnBoot() {
key, err := registry.OpenKey(registry.CURRENT_USER, RegistryKey, registry.READ|registry.WRITE)
if err != nil {
fmt.Println("Error opening registry key:", err)
return
}
defer key.Close()
exePath, err := os.Executable()
if err != nil {
fmt.Println("Error getting executable path:", err)
return
}
val, _, err := key.GetStringValue(AppName)
if err == nil {
// Mieru value exists in registry
if val != exePath {
// Update registry value if the executable path is different
err = key.SetStringValue(AppName, exePath)
if err != nil {
fmt.Println("Error updating registry value:", err)
}
}
startOnBoot = true
} else if err == registry.ErrNotExist {
// Mieru value does not exist in registry, set startOnBoot to false
startOnBoot = false
} else {
fmt.Println("Error reading registry value:", err)
}
}
func saveStartOnBoot() {
key, err := registry.OpenKey(registry.CURRENT_USER, RegistryKey, registry.WRITE)
if err != nil {
fmt.Println("Error opening registry key:", err)
return
}
defer key.Close()
exePath, err := os.Executable()
if err != nil {
fmt.Println("Error getting executable path:", err)
return
}
val, _, err := key.GetStringValue(AppName)
if err != nil || val != exePath {
if startOnBoot {
err = key.SetStringValue(AppName, exePath)
if err != nil {
fmt.Println("Error writing registry value:", err)
}
} else {
err = key.DeleteValue(AppName)
if err != nil {
fmt.Println("Error deleting registry value:", err)
}
}
}
}
func updateStartOnBoot(startOnBootItem *systray.MenuItem) {
if startOnBoot {
startOnBootItem.Check()
} else {
startOnBootItem.Uncheck()
}
}