This program will monitor your Mac for input (keyboard and mouse activity). As soon as it detects the computer has been idle for a configurable number of seconds, it will take a picture using the webcam and use Computer Vision to check if there is a face looking at the computer. If it cannot detect a face it will immediately put the display to sleep (which, if the settings are configured correctly, should cause the display to lock).
- Install Go
- Install Homebrew
- Install GoCV package:
go get -u -d gocv.io/x/gocv
- Install OpenCV:
brew install opencv
- Install PkgConfig:
brew install pkgconfig
- Clone this repository:
git clone https://github.com/jjviana/antidonuts.git
- Build:
cd antidonuts; go build .
- Run:
./antidonuts --help