O, Hai Der!

My humble opinions

Start/Stop Screensaver and Wake/sleep Display via Command Line (Mac OS X)

I have a Mac Mini installed as a multimedia server in my room, attached to a small display that was hanging around, and I wish to put the display to sleep or start my beautiful screen saver via a quick ssh command since I’ve decided to not to attach a keyboard nor a mouse to the server.

To start the screensaver,

1
alias startss='open -a /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'

To stop the screensaver,

1
alias stopss='killall -1 ScreenSaverEngine'

To wake the display,

1
alias wakedisplay='TIME="$(date -v +6S '+%m/%d/%Y %H:%M:%S')"; sudo pmset schedule wake $TIME'

To sleep the display,

  1. Download Sleep Display
  2. Copy the binary file from the content to /usr/local/bin

Reference link:

  1. http://onethingwell.org/post/3504021412/pmset
  2. http://apple.stackexchange.com/questions/53802/waking-display-from-terminal-general-waking

Comments