Disable sleep schedule in MacOS Sonoma
At some point the ability to control the sleep schedule was remove from the Mac OS Sonoma UI. I spent time in vain enabling and disabling various settings until I found the pmset command. Running the following in a terminal window I was able to see my current schedule.
% sudo pmset -g sched
Repeating power events:
wakepoweron at 7:00AM weekdays only
sleep at 10:00PM every day
Scheduled power events:
[0] wake at 08/02/2024 14:02:37 by 'com.apple.alarm.user-invisible-com.apple.calaccessd.travelEngine.periodicRefreshTimer'
[1] wake at 08/02/2024 22:06:06 by 'com.apple.alarm.user-invisible-com.apple.acmd.alarm'The -g flag tells pmset to retrieve the value of the option sched. Notice that the option spelling is schedvs schedule used in other parts of the pmset command. This caused me a lot of confusion initially as I tried to run the invalid command sudo pmset -g schedule that pmset politely (RTFM) replies with
Error: unhandled argument schedule
Usage: pmset <options>
See pmset(1) for details: 'man pmset'Now that I can see my schedule I need to remove the repeating events. Follwing the example in the man page
% man pmset
.............
Cancels all scheduled system sleep, shutdown, wake, and power on events.
pmset repeat cancelRunning and checking the schedule after
% sudo pmset repeat cancel
Password:
% sudo pmset -g sched
Scheduled power events:
[0] wake at 08/02/2024 14:02:37 by 'com.apple.alarm.user-invisible-com.apple.calaccessd.travelEngine.periodicRefreshTimer'
[1] wake at 08/02/2024 22:06:06 by 'com.apple.alarm.user-invisible-com.apple.acmd.alarm'Now the repeating event was gone, I want to remove any future scheduled events. Running the following and checking again
% sudo pmset schedule cancelall
Password:
% sudo pmset -g sched
%