Waking display from terminal, general waking

sleep-waketerminal

This is a two part question. A practical, "how to" question is first, and then I ask for configuration suggestions.

First, I put my displays to sleep at night, and I would like to be able to wake the display remotely. Is there a command line utility I can use to wake it via SSH? I know about WakeOnLan, but that seems like overkill.

Second, the whole reason for me wanting to wake my display remotely has to do with how Lion's power savings settings changed. The Apple infrared remote no longer wakes the display. This is a huge deal for a machine I originally bought to be a combined desktop/home theater pc, since it defeats half of its purpose. So, does anybody have any ideas/suggestions what to do about this? This is open ended, I know.

Best Answer

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).