Put the display to sleep without putting the whole computer to sleep?

I like to use vnc on my ipad on my bed. I want the mac to go to a black screen so I can fall asleep while using the ipad, and not have to get up to shut down the mac afterwards. Is there anyway to turn off the imac screen without sleeping?

I'm open to anything that minimizes the light - so if the backlight is off, that would meet the needs even if the screen is still drawing content.

From a semantics standpoint, let's assume the following:

When the system sleeps, the display sleeps or a screensaver engages are all distinct states. The display is asleep when the backlight is off and the GPU doesn't bother drawing any signal to that display but continues to run. This is different than system sleep where everything except the RAM and network interfaces1 are shut off.

1: Network interfaces that support wake on lan (WOL) only do so when power not from a battery is available.


Solution 1:

You can turn off your iMac (and your macbook) screen without sleeping via the following keyboard shortcut:

+ +

(Control +SHIFT + EJECT)

Machines like the Air and newer MacBook Pro with no optical drives have the power button in the same place as the eject key and it works similarly for display sleeping shortcuts.

Solution 2:

In Terminal.app:

pmset displaysleepnow

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pmset.1.html

This also works for the lock and sleep functions:

pmset sleepnow
pmset lock

Solution 3:

Your first stop should be the energy saver preference pane. Dial down the Display sleep slider as short as you can stand it.

enter image description here

If you don't want to wait for this time out, you could also set a hot corner and black screensaver so you could use VNC to set the mouse pointer to the corner to engage a black screensaver so the screen is as dim as possible until the sleep timer shuts off the LCD lighting as well as the data to the iMac screen.

Solution 4:

On computers without an eject button (iMac with non-Apple keyboard; 2011 MacBook Air; etc.), it becomes difficult to put the display to sleep without using a hot corner. The following script will do the job (in Leopard and later), but it must be run with sudo:

#!/bin/bash
original_setting=`/usr/bin/pmset -g | /usr/bin/grep displaysleep | /usr/bin/awk '{print $2}'`
echo $original_setting
magic_number=2147483648
/usr/bin/pmset -a displaysleep $magic_number; sleep 1; /usr/bin/pmset -a displaysleep $original_setting