Created
August 11, 2022 09:44
-
-
Save therealFoxster/1930c9e6c0423a16688cfbe04ca4c566 to your computer and use it in GitHub Desktop.
A fix for SendLaterDelivery causing high CPU usage (powerd) on macOS 13.0 beta. Tested on 13.0b5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
idle=10 #minutes | |
echo -n "${WBOL}[$(date +'%H:%M')]${WDEF} checking pm schedules; " | |
sched=$(pmset -g sched) | |
if [[ $sched != "" ]]; then | |
echo -n "found schedule(s); cancelling all; " | |
if pmset schedule cancelall; then | |
echo -n "cancelled all schedules; " | |
else | |
echo -n "unable to cancel all schedules (an error occurred); " | |
fi | |
else | |
echo -n "no schedules found; " | |
fi | |
echo -en "next check @$(date -v+${idle}M +'%H:%M');\n" | |
sleep $((60*$idle)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment