I was able to immediately display the display with
pmset displaysleepnow
in the terminal, however, to wake up the display, I found only
pmset schedule wake "12/24/2009 00:00:00"
which does not work if I try to plan something earlier than at least 10 seconds.
Is there a way to wake up the display programmatically in Cocoa? Someone suggested IOPMAssertionDeclareUserActivity, but I could not find any examples, so I'm afraid.
I use Swift, by the way, but Objective-C code is also welcome.
Thank!
source
share