1

When I run this command:

sudo systemsetup -getcomputersleep

I'm getting this:

Computer Sleep: after 55 minutes

And that corresponds to the setting in the "Energy Saver" Preference panel, the setting "Turn display off after".

So now I'm wondering what happens exactly after 55 minutes? Does the computer actually go to sleep (i.e. all activity is stopped) or is it only switching off the screen?

The command line and preferences use wordings that for me means completely different things so I'm just wondering which one is right?

  • There are two different options in systemsetup command, -getcomputersleep and getdisplaysleep. Can you re-read the question and ensure which one you are referring to? – Nimesh Neema Apr 29 at 15:22
  • getdisplaysleep also returns 55 minutes – laurent Apr 29 at 17:01
  • My goal basically is to make sure that the computer stays on. I want the screen to go off but not the computer to sleep. How can I be sure of this? – laurent Apr 29 at 17:26
  • How about using a utility that prevents computer sleep altogether? You will have to turn off the display or turn down the brightness manually. – Nimesh Neema Apr 29 at 17:36
1

systemsetup

From the command line you can confirm the state of your sleep situation using the -getsleep argument to systemsetup.

$ sudo systemsetup -getsleep
Sleep: Computer sleeps Never
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes

This setup was accomplished by setting the preferences under "Energy Saver" section of System Preferences like this:

ss

This shows that the display will be turned off after 10 minutes but the system itself will remain powered on. Pay special attention to the tabs in this dialog as well. The settings are different when on battery vs. the power adapter.

NOTE: If we were to unset that checkbox so that the system won't be prevented from going to sleep along with the display the output form systemsetup changes to this:

$ sudo systemsetup -getsleep
Sleep: Computer sleeps after 10 minutes
Sleep: Display sleeps after 10 minutes
Sleep: Disk sleeps after 10 minutes

You can see all the get* settings from systemsetup like this:

$ sudo systemsetup -help|grep "get.*sleep"
Usage: systemsetup -getsleep
Usage: systemsetup -getcomputersleep
Usage: systemsetup -getdisplaysleep
Usage: systemsetup -getharddisksleep
Usage: systemsetup -getallowpowerbuttontosleepcomputer

You can also augment the settings from the CLI as well:

$ sudo systemsetup -help | grep -- "-set.*sleep"
Usage: systemsetup -setsleep <minutes>
Usage: systemsetup -setcomputersleep <minutes>
Usage: systemsetup -setdisplaysleep <minutes>
Usage: systemsetup -setharddisksleep <minutes>
Usage: systemsetup -setallowpowerbuttontosleepcomputer <on off>

pmset

Additionally there's another tool you can use to get/set timings related to the various "sleep" aspects of your system.

$ pmset -g
System-wide power settings:
 DestroyFVKeyOnStandby      0
Currently in use:
 standby              1
 standbydelaylow      10800
 womp                 1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 proximitywake        1
 powernap             1
 gpuswitch            2
 networkoversleep     0
 disksleep            10
 standbydelayhigh     86400
 sleep                0
 hibernatemode        3
 ttyskeepawake        1
 displaysleep         10
 tcpkeepalive         1
 highstandbythreshold 50
 acwake               0
 lidwake              1
  • Thank you for the explanation, that makes sense now. – laurent Apr 30 at 8:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .