diff --git a/duck2.jpg b/duck2.jpg new file mode 100644 index 0000000..b7a74b7 Binary files /dev/null and b/duck2.jpg differ diff --git a/main.go b/main.go index f49c930..30d253d 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "os" "syscall" + // _ "embed" "fyne.io/systray" hook "github.com/robotn/gohook" ) @@ -17,6 +18,8 @@ var ( GetForegroundWindow = us32.MustFindProc("GetForegroundWindow") ) +// //go:embed duck2.jpg +//var icon []byte var Error *log.Logger var Warning *log.Logger @@ -44,7 +47,7 @@ const ( ) func main() { - systray.Run(onReady, onExit) + systray.Run(onReady, nil) keyEvents := make(chan *hook.Event, 4096) hook.Register(hook.KeyDown, []string{}, func(e hook.Event) { keyEvents <- &e @@ -92,11 +95,13 @@ func main() { } func onReady() { - systray.SetIcon(icon.Data) + // Icons no workey... idk why... + // systray error: unable to set icon: The operation completed successfully. + //systray.SetIcon(icon) systray.SetTitle("Awesome App") systray.SetTooltip("Pretty awesome超级棒") - mQuit := systray.AddMenuItem("Quit", "Quit the whole app") + //mQuit := systray.AddMenuItem("Quit", "Quit the whole app") // Sets the icon of a menu item. Only available on Mac and Windows. - mQuit.SetIcon(icon.Data) + //mQuit.SetIcon(icon) }