sleepwatcher
« Back to VersTracker
Description:
Monitors sleep, wakeup, and idleness of a Mac
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: System utilities
Tags: macos automation system-utility sleep idle daemon
Install: brew install sleepwatcher
About:
Sleepwatcher is a command-line utility that monitors system sleep, wakeup, and idle events on macOS. It allows users to execute custom scripts or commands automatically when these system state changes occur. This enables automation of tasks like cleaning up files, managing external devices, or locking the system based on user inactivity.
Key Features:
  • Monitors sleep, wakeup, and idle events via command-line
  • Triggers custom scripts or commands on state changes
  • Lightweight and runs as a background daemon
  • Configurable idle time thresholds
Use Cases:
  • Automatically lock the Mac when the system becomes idle
  • Run cleanup scripts before the system goes to sleep
  • Eject external drives or unmount volumes on sleep
  • Pause and resume media playback based on user presence
Alternatives:
  • Power Management Events (pmset) – pmset can schedule sleep/wake but lacks direct idle event monitoring and script execution capabilities.
  • launchd – launchd can run scripts on intervals or specific triggers but does not natively monitor system sleep or idle states without helper tools.
Version History
Detected Version Rev Change Commit
Sep 13, 2024 11:12pm 0 VERSION_BUMP 672f9866