Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Doug Lass

macrumors member
Original poster
Mar 12, 2015
94
13
In High Sierra, in order to keep my Mac from going to sleep for three hours, I would do "sudo pmset -c displaysleep 180". That worked! That doesn't seem to work in Sonoma. At least the Lock Screen numbers don't change when I do that. That is, if I want to command this in terminal, instead of with System Settings, how do I do it in Sonoma?
 

gilby101

macrumors 68030
Mar 17, 2010
2,946
1,630
Tasmania
What model Mac? In particular Apple silicon or Intel processor.
Might be worth showing output from pmset -g when connected to power.
Why do you use displaysleep rather than sleep?
 

genexx

macrumors regular
Nov 11, 2022
221
124
Bash:
sudo pmset -c displaysleep 180

works on my Sonoma, maybe it is different on HS so try
Bash:
man pmset
to get the related info.

pmset can modify the values of any of the power management settings defined below. You may specify one or more setting & value pairs on the command-line invocation of

pmset. The -a, -b, -c, -u flags determine whether the settings apply to battery ( -b ), charger (wall power) ( -c ), UPS ( -u ) or all ( -a ).

Use a minutes argument of 0 to set the idle time to never for sleep disksleep and displaysleep

pmset must be run as root in order to modify any settings.

Bash:
sudo pmset displaysleep 180
 
Last edited:

Doug Lass

macrumors member
Original poster
Mar 12, 2015
94
13
OK, apologies. It's all working now. One mistake I was making was using that command WHILE the System Settings Lock Screen page was open. That won't work. I neglected to say that I upgraded from a MacBookPro2011 to a MacBookAir M2 with Sonoma. Thank you, everyone.
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,238
13,306
Slightly off-topic...

Is there a terminal command that toggles on/off the requirement for password entry after display sleep or full (computer) sleep?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.