Battery settings - Check prevent Mac from automatically sleeping when screen is off

tgazelle
New Contributor II
Hi ! 

I'm looking for how to check prevent Mac from automatically sleeping when screen is off in battery settings. I don't have this feature in configuration profiles.

Capture-d-e-cran-2022-08-23-a-17-51-48

 

Do you know a solution ? Unfortunately I couldn't find anything :(

 

Regards

4 REPLIES 4

sdagley
Esteemed Contributor II

@tgazelle The following command should prevent sleep while on battery power:

 

/usr/bin/pmset -b sleep 0

 

If you're running that from a jamf policy the a 'sudo ' prefix isn't necessary

tgazelle
New Contributor II

@sdagley thanks for your reply. When I launch this command in my terminal nothing happens and the checkbox remains unchecked. 

sdagley
Esteemed Contributor II

@tgazelle Did you include sudo before the command when you ran it in Terminal? And was System Preferences closed when you ran it? If the Battery panel is open the setting isn't going to update visually, and when you close the Battery panel it may overwrite the setting.

tgazelle
New Contributor II

@sdagley yes sudo is include before the command in my Terminal. I closed all the windows but settings battery settings not changing.