diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c65423f --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +start: + go run cmd/main.go \ No newline at end of file diff --git a/cmd/main.go b/cmd/main.go index d284409..5868ce2 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -31,7 +31,7 @@ func onReady() { //notify.SendMessage("starting the app") case <-ammStop.ClickedCh: - fmt.Println("pausing the app") + fmt.Println("stopping the app") mouseMover.Quit() case <-mQuit.ClickedCh: diff --git a/glide.lock b/glide.lock index 6ed542d..8794a16 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ hash: 0e9d554853b2c3ed23ba323715540d961c06465a1a125959a698d6162e17f91d -updated: 2019-03-20T12:29:04.478748-07:00 +updated: 2019-03-22T15:34:56.64781-07:00 imports: - name: github.com/BurntSushi/xgb version: 27f122750802c950b2c869a5b63dafcf590ced95 @@ -41,6 +41,8 @@ imports: version: 193b4935d4b146c729d763c2c59a0d3e7f3cee8a subpackages: - clipboard +- name: github.com/konsorten/go-windows-terminal-sequences + version: f55edac94c9bbba5d6182a4be46d86a2c9b5b50e - name: github.com/lxn/win version: 0040366d745006bbf7528ac96de2de375846aa79 - name: github.com/otiai10/gosseract @@ -48,8 +50,13 @@ imports: - name: github.com/oxtoacart/bpool version: 8c4636f812cc8920c26e2002b988c878b1fd6f5e - name: github.com/prashantgupta24/activity-tracker - version: 7330e5e8a948db11beb7aef23996d37ef26977f4 + version: d60ddb4a3211e471b1a3fcd9b5dec960a453c79c subpackages: + - internal/pkg/logging + - internal/pkg/mouse + - internal/pkg/service + - pkg/activity + - pkg/tracker - src/activity - src/mouse - name: github.com/robotn/gohook @@ -65,16 +72,22 @@ imports: - process - name: github.com/shirou/w32 version: bb4de0191aa41b5507caa14b0650cdbddcd9280b +- name: github.com/sirupsen/logrus + version: dae0fa8d5b0c810a8ab733fbd5510c7cae84eca4 - name: github.com/StackExchange/wmi version: e0a55b97c70558c92ce14085e41b35a894e93d3d - name: github.com/vcaesar/imgo version: 13af122cf2fa6117048933e141c0b52f19116ca6 +- name: golang.org/x/crypto + version: b7391e95e576cacdcdd422573063bc057239113d + subpackages: + - ssh/terminal - name: golang.org/x/image - version: 0694c2d4d067f97ebef574d63a763ee8ab559da7 + version: 3fc05d484e9f77dd51816890e05f2602e4ca4d65 subpackages: - bmp - name: golang.org/x/sys - version: 6c81ef8f67ca3f42fc9cd71dfbd5f35b0c4b5771 + version: f49334f85ddcf0f08d7fb6dd7363e9e6d6b777eb subpackages: - unix - windows diff --git a/pkg/mousemover/mouseMover.go b/pkg/mousemover/mouseMover.go index 7d81172..cf9507f 100644 --- a/pkg/mousemover/mouseMover.go +++ b/pkg/mousemover/mouseMover.go @@ -26,6 +26,7 @@ func (m *mouseMover) Start() { frequency := 5 //value always in seconds activityTracker := &tracker.Instance{ Frequency: frequency, + //LogLevel: "debug", //if we want verbose logging } heartbeatCh := activityTracker.Start() @@ -42,7 +43,7 @@ func (m *mouseMover) Start() { select { case wasMouseMoveSuccess := <-commCh: if wasMouseMoveSuccess { - fmt.Println("moving mouse at : \n", time.Now()) + fmt.Printf("\nmoving mouse at : %v\n\n", time.Now()) movePixel *= -1 } case <-time.After(timeout * time.Millisecond): @@ -71,7 +72,7 @@ func moveMouse(movePixel int, commCh chan bool) { func (m *mouseMover) Quit() { //making it idempotent - if !m.isRunning { + if m != nil && m.isRunning { m.quit <- struct{}{} } }