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

m_emelchenkov

macrumors regular
Original poster
Mar 27, 2017
136
86
I want to use Power button to turn off display rather than put computer to sleep. How to achieve this? I see:
% pmset -g

Sleep On Power Button 1


But don't see how to set this option to 0.
 
Not sure it is possible. But you can enable a "Hot Corner". Move you mouse pointer to the "Hot Corner" to sleep display.

Settings > Desktop & Dock > scroll bottom, press "Hot Corners..." button. Choose your corner and select "Put Display to Sleep".
 
  • Like
Reactions: chabig
Not sure it is possible. But you can enable a "Hot Corner". Move you mouse pointer to the "Hot Corner" to sleep display.

Settings > Desktop & Dock > scroll bottom, press "Hot Corners..." button. Choose your corner and select "Put Display to Sleep".
Yes, I used it in the past, just wanted to make the process more comfortable to me.
 
There used to be a powerbutton option in pmset, but Apple seems to have removed it, at least since 10.11 El Capitan from what I’ve tested.
“powerbutton - Sleep the machine when power button is pressed (value=0/1)” https://ss64.com/mac/pmset.html


The settings are now saved in /Library/Preferences/com.apple.PowerManagement.plist and you could try to
read the values
Code:
defaults read /Library/Preferences/com.apple.PowerManagement.plist

write "Sleep On Power Button" 0
Code:
sudo defaults write /Library/Preferences/com.apple.PowerManagement.plist "Sleep On Power Button" 0

write "Sleep On Power Button" 1
Code:
sudo defaults write /Library/Preferences/com.apple.PowerManagement.plist "Sleep On Power Button" 1

delete "Sleep On Power Button" 1
Code:
sudo defaults delete /Library/Preferences/com.apple.PowerManagement.plist "Sleep On Power Button"

On MBA M1 I have sleep disabled and the power button locks the screen.
 
I don’t have Sequoia on a real Mac, only virtual machines.
These are my settings in Sonoma 14.7.1:
pmset -g
System-wide power settings:
SleepDisabled 1
Currently in use:
standby 0
Sleep On Power Button 1
hibernatefile /var/vm/sleepimage
powernap 1
networkoversleep 0
disksleep 0
sleep 0 (sleep prevented by coreaudiod, powerd)
hibernatemode 0
ttyskeepawake 1
displaysleep 3
tcpkeepalive 1
lowpowermode 1
womp 0

Pressing the power button locks the screen and turns off the display. I don’t have TouchID set up.
 
  • Like
Reactions: m_emelchenkov
The settings are now saved in /Library/Preferences/com.apple.PowerManagement.plist
Despite of `pmset -g` output (still 1) your advice works! Thanks a lot!!! Now I can put display to off with Power Button rather sending whole machine to sleep.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.