• Stars
    star
    32
  • Rank 801,432 (Top 16 %)
  • Language
    Go
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

macOS Sleep/ Wake notifications in golang

Mentioned in Awesome Go Go Report Card codecov version godoc-badge

macOS Sleep/ Wake notifications in golang

Inspired from this blog.

This libary notifies through a channel whenever your machine is put to sleep or is woken up. Calling the Start function will get you a channel on which you receive both Sleep and Awake activities.

Installation

go get -u github.com/prashantgupta24/mac-sleep-notifier/notifier

Usage

notifierCh := notifier.GetInstance().Start()

for {
	select {
	case activity := <-notifierCh:
		if activity.Type == notifier.Awake {
			log.Println("machine awake")
		} else {
			if activity.Type == notifier.Sleep {
				log.Println("machine sleeping")
			}
		}
	}
}

Example

See example here

More Repositories

1

firewalld-rest

A rest application to update firewalld rules on a linux server
Go
338
star
2

automatic-mouse-mover

a minimalistic go library/app to keep your mac active and alive
Go
288
star
3

activity-tracker

A library to notify about any (pluggable) activity on your machine, and let you take action as needed
Go
28
star
4

lua-top-down-multiplayer

A simple top-down multiplayer game built using LÖVE
Lua
19
star
5

clipboard-manager

Clippy - A minimalistic clipboard manager in python
Python
16
star
6

go-clip

A minimalistic clipboard manager for Mac.
Go
13
star
7

snake-javascript

Learning sockets and javascript the fun way. This is the snake game using javascript and p5! Includes a leaderboard! (p5.js + socket.io + cookies + redis backend)
JavaScript
8
star
8

OpenWeatherMap

An app to query the OpenWeatherMap api and display the results on an HTML page. Uses Ajax, Express and Needle
HTML
2
star
9

python-air-hockey

An air hockey game in python using pyxel
Python
2
star
10

Ring-Message

An Android app which lets you save personalized messages for contacts, so when they call you or you call them, message pops up on screen reminding you what to ask or say!
Java
2
star
11

MyWebApplication

A simple web application which uses Servlets, JSP's, JSTL, Ajax and Hibernate
Java
2
star
12

bulk-email-downloader

A bulk email downloader from an IMAP server written in go
Go
2
star
13

vercel-js

JavaScript
1
star
14

go-fantasy

A golang based fantasy premier league scraper!
Go
1
star
15

go-design-patterns

go-design-patterns
Go
1
star
16

git-test

Testing git features
1
star
17

Salt-Stack

An attempt to understand Salt Stack and it's use in configuration management
Shell
1
star
18

go_scraper

a web scraper in go
Go
1
star
19

semantic-release-golang

A repo to test automatic semantic releaser for golang
1
star
20

mozart

An orchestrator to control script execution - moved to URL below
1
star
21

rock-paper-scissors

Playing rock, paper and scissors using Visual Recognition (with IBM Watson) using the webcam!
Python
1
star
22

go-chat

HTML
1
star
23

Coderbyte-challenges

Challenges completed for coderbyte.com
Java
1
star
24

bash_backup

Shell
1
star
25

go-fantasy-grpc

The gRPC implementation of my go-fantasy application. Purely for learning go-lang and grpc!
Go
1
star
26

prashantgupta24

1
star
27

tic-tac-toe

the famous tic-tac-toe in javascript! Complete with AI or 2 player ! (minimax + socket.io)
JavaScript
1
star
28

REST-messenger

A messenger application using RESTful web services
Java
1
star
29

python-web-scraper

A scraper in python for collecting car data from a website
Jupyter Notebook
1
star