Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I keep the Mac running (not going to sleep) with its display turned off without having to go to Energy Saving settings to set display sleep to low and computer sleep to high?

I tried the caffeinate command and Caffeine software with no luck - both work OK (prevent the computer to go asleep) with display ON, but as soon as I turn the monitor off with Ctrl+Shift+Eject the computer goes asleep in a minute too, ignoring the caffeinate.

I use the computer as file server, so I need it to keep running, but having the display turned on is unnecessary.

Can you suggest an application?

share|improve this question
Did you try hot corners with a corner selected for display off? – AbhishekGirish Oct 27 '12 at 12:39
@AbhishekGirish: Yes. I can turn the display off, the problem is that it does disable the caffeinate function and the whole computer goes asleep in a while after. – František Žiačik Oct 27 '12 at 13:03
up vote 1 down vote accepted

Did you try caffeinate -s?

-i      Create an assertion to prevent the system from idle sleeping.

-s      Create an assertion to prevent the system from sleeping. This assertion is valid only when system is running on AC power.

If there was some way to check if displays have been put to sleep, you could run a script every minute that would temporarily change pmset sleep to 0 during display sleep.

share|improve this answer
Yes, -s works, can't believe I missed this! Thank you! – František Žiačik Oct 27 '12 at 14:51

You can also use this menubar app to avoid sleep:

share|improve this answer

You must log in to answer this question.

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