How to set system sleep delay on macOS Mojave
If you leave your system unattended, and unused for too long, it will automatically go to sleep. This is a standard feature on all desktop operating systems but some choose to let the user decide how long the system should be inactive before it is put to sleep while others decide for the user. If you want to set system sleep delay on macOS, you’re going to have to do it via the Terminal.
The System Preferences app does not let you customize this particular setting. You can only choose when your display is put to sleep from the Energy Saver preference.
Set system sleep delay
Open the Terminal and run the following command;
pmset -g
In the results, look for the value next to Sleep. This is the time, in minutes, that your system must be idle/unused before it is put to sleep.
To change it, run the following command in the Terminal;
sudo pmset -a sleep <minutes>
Replace minutes with the number of minutes you want your system to wait before it is put to sleep.
Example
sudo pmset -a sleep 10
Tap Enter and, if prompted, enter the admin password. Your new system sleep delay will be set.
Battery & energy consumption
macOS used to allow users control over the system sleep delay time however, Apple has been focusing on giving users ways to manage power consumption and battery use on MacBooks. It doesn’t have anything as sophisticated as dedicated power plans like Windows 10 does so instead, it tries to decide what’s best for the user by assuming they always want to conserve battery charge.
It’s because of this that certain settings can no longer be customized by the average user. If a user decided to prolong the system sleep delay past the default that is set in the OS, they will likely consume more battery. Locking this feature down means no one can accidentally change the system sleep delay on macOS. Users can only set when their display is put to sleep.
Although there has been a focus on saving energy on MacBooks for a while now, the Energy Saver preference doesn’t offer up much except for the Power Nap feature that users can enable/disable whenever they want. Users are still free to change the brightness of the display even if they’re low on battery, and disable display dimming on battery altogether. Both will have a significant impact on how long a battery charge lasts.
Users have also found ways to disable sleep altogether.
I just updated from El Capitan to Mojave, (I have my reasons, lol), and it was set to go to screen saver after an hour. Now the thing goes to sleep after ten minutes, then actually powers down after awhile! Where are these settings now in the GUI?
I need this thing to stay running. The sleep thing is an annoyance, but not critical, as long as stuff keeps running in the background. How can I keep this thing from powering down?
sudo pmset -a displaysleep 0
sudo pmset -a autopoweroff 0
Hopefully, this gets it.
$ pmset -g custom
AC Power:
Sleep On Power Button 1
autopoweroff 0
standbydelayhigh 86400
autopoweroffdelay 28800
standbydelaylow 86400
standby 0
ttyskeepawake 1
hibernatemode 0
powernap 1
gpuswitch 2
hibernatefile /var/vm/sleepimage
highstandbythreshold 50
displaysleep 0
womp 1
networkoversleep 0
sleep 1
halfdim 1
autorestart 0
disksleep 10