- Notifications
You must be signed in to change notification settings - Fork7
macOS Sleep/ Wake notifications in golang
License
NotificationsYou must be signed in to change notification settings
prashantgupta24/mac-sleep-notifier
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Inspired fromthis blog.
This libary notifies through a channel whenever your machine is put to sleep or is woken up. Calling theStart
function will get you a channel on which you receive bothSleep
andAwake
activities.
go get -u github.com/prashantgupta24/mac-sleep-notifier/notifier
notifierCh:=notifier.GetInstance().Start()for {select {caseactivity:=<-notifierCh:ifactivity.Type==notifier.Awake {log.Println("machine awake")}else {ifactivity.Type==notifier.Sleep {log.Println("machine sleeping")}}}}
See examplehere
About
macOS Sleep/ Wake notifications in golang
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.