-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
45 lines (38 loc) · 955 Bytes
/
main.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
package main
import (
"github.com/kermieisinthehouse/systray"
"github.com/kopia/ui-shell/icons"
)
func main() {
systray.Run(onReady, onExit)
}
func onReady() {
systray.SetIcon(icons.TrayIcon)
//systray.SetTitle("KopiaUI")
systray.SetTooltip("KopiaUI")
systray.AddMenuItem("<starting up>", "Starting up...")
systray.AddMenuItem("<starting up>", "Starting up...")
systray.AddSeparator()
systray.AddMenuItem("Connect To Another Repository...", "")
systray.AddSeparator()
mLaunchAtStartup := systray.AddMenuItemCheckbox("Launch At Startup", "Automatically launch at startup", false)
mQuit := systray.AddMenuItem("Quit", "Quit the whole app")
go func() {
for {
select {
case <-mQuit.ClickedCh:
systray.Quit()
return
case <-mLaunchAtStartup.ClickedCh:
if mLaunchAtStartup.Checked() {
mLaunchAtStartup.Uncheck()
} else {
mLaunchAtStartup.Check()
}
}
}
}()
}
func onExit() {
// clean up here
}