sleepwatcher

Install command:
brew install sleepwatcher

Monitors sleep, wakeup, and idleness of a Mac

https://www.bernhard-baehr.de/

License: GPL-3.0-or-later

Development: Pull requests

Formula JSON API: /api/formula/sleepwatcher.json

Formula code: sleepwatcher.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
tahoe
sequoia
sonoma
ventura
monterey
big sur
macOS on
Intel
sonoma
ventura
monterey
big sur

Current versions:

stable 2.2.1

Requires: macOS

Service:

Start now and at login: brew services start sleepwatcher
Run directly: $HOMEBREW_PREFIX/opt/sleepwatcher/sbin/sleepwatcher -V -s /$HOME/.sleep -w /$HOME/.wakeup
For SleepWatcher to work, you will need to write sleep and
wakeup scripts, located here when using brew services:

    ~/.sleep
    ~/.wakeup

Analytics:

30 days90 days365 days
Installs4161,4485,365
Installs (--HEAD)005
Installs on Request4161,4475,346
Installs on Request (--HEAD)005
Build Errors0