This macOS CPU monitoring script automatically tracks resource usage across all applications, addressing the challenge of identifying performance-impacting processes. It sends notifications when apps exceed CPU thresholds, enabling user to quickly manage power-hungry tasks. Ideal for developers, content creators, and power users. Lightweight and integrated with macOS, offers ongoing monitoring without significant system overhead.
- Download the script and save it to your home directory, e.g.
~/Applications/. - Open Terminal and run the following command to make the script executable:
chmod +x setup_cpu_monitor.sh
- Run the script with the following command:
./setup_cpu_monitor.sh
- Configure the desired thresholds as prompted.
- The script will start monitoring CPU usage and send notifications when thresholds are exceeded.
Note
You will receive notifications when CPU usage exceeds the set thresholds.
The monitoring starts automatically when you log in.
-
To reconfigure CPU monitoring:
~/setup_cpu_monitor.sh -
To stop CPU monitoring:
~/setup_cpu_monitor.sh stop -
To manually start monitoring after stopping:
launchctl enable gui/$(id -u)/com.user.cpumonitor && launchctl bootstrap gui/$(id -u) "~/Library/LaunchAgents/com.user.cpumonitor.plist"
Don't worry: the script evaluates your available CPU cores as a baseline to suggest suitable values based on the following calculations:
- Single Process % CPU usage threshold: 25% of total capacity
- Overall System % CPU threshold: 85% of total capacity
- Check interval: 60 seconds per core