From b7b8ed2ecdf29eb071709830412afb7606af4cab Mon Sep 17 00:00:00 2001 From: Prashant Gupta Date: Thu, 19 Aug 2021 12:01:27 -0700 Subject: [PATCH] about + enable default --- cmd/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index ce0579a..48d36a6 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,6 +1,7 @@ package main import ( + "github.com/go-vgo/robotgo" log "github.com/sirupsen/logrus" "github.com/getlantern/systray" @@ -15,6 +16,8 @@ func main() { func onReady() { go func() { systray.SetIcon(icon.Data) + about := systray.AddMenuItem("About AMM", "Information about the app") + systray.AddSeparator() ammStart := systray.AddMenuItem("Start", "start the app") ammStop := systray.AddMenuItem("Stop", "stop the app") ammStop.Disable() @@ -23,6 +26,9 @@ func onReady() { // Sets the icon of a menu item. Only available on Mac. //mQuit.SetIcon(icon.Data) mouseMover := mousemover.GetInstance() + mouseMover.Start() + ammStart.Disable() + ammStop.Enable() for { select { case <-ammStart.ClickedCh: @@ -43,6 +49,10 @@ func onReady() { mouseMover.Quit() systray.Quit() return + + case <-about.ClickedCh: + log.Infof("Requesting about") + robotgo.ShowAlert("Automatic-mouse-mover app", "Developed by Prashant Gupta. \n\nMore info at: https://github.com/prashantgupta24/automatic-mouse-mover") } }