Skip to main content
Question

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

  • August 23, 2022
  • 4 replies
  • 41 views

Forum|alt.badge.img+3
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

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3567 replies
  • August 23, 2022

@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


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • August 24, 2022

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


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3567 replies
  • August 24, 2022

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


@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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • August 25, 2022

@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.


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