Skip to main content
Question

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

  • Aug 23, 2022 4:01 PM UTC
  • 4 replies
  • 161 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
  • Aug 23, 2022 6:22 PM UTC

@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
  • Aug 24, 2022 7:16 AM UTC

@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
  • Aug 24, 2022 12:39 PM UTC

@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
  • Aug 25, 2022 12:07 PM UTC

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