Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

You can also use this menubar app to avoid sleep:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.