Waking display from terminal, general waking

The easiest way to do this over SSH is to use caffeinate -u (available since OS X 10.9 I think) to simulate user activity.

Add the flag -t 5 to specify a timeout of 5 seconds (else you'd have to ctrl+c out of caffeinate, it seems).


Wake: caffeinate -u -t 2

Sleep: pmset displaysleepnow


You can use

pmset schedule wake "01/01/2012 20:00:00"

to wake up a sleeping display on an otherwise "awake" Mac. Replace the date/time part with current time of course.


Waking the Display from the Command Line

For waking your display remotely, try running an AppleScript on the command line:

osascript -e 'tell application "System Events" to key code 123'

This will simulate pressing the cursor key and should make Mac OS X 10 believe a user is active on the computer.

This AppleScript is based on the answer, How do I automate a key press in AppleScript?

Waking the Display after Waking with the Remote

If you are waking your Mac using the remote and the display is not powering on, try Wake Assist. It is not designed for this situation but might just work.

Wake Assist simulates a mouse click after your Mac wakes up. The mouse is clicked twice in the upper-left of your main display. Wake Assist will do nothing if it detects a user but if the computer wakes and is idle, then the mouse is clicked for you.