*HELP* With a Script or Automation

I just simply need a way to "trigger" sleep/wake, when "something" happens.

My first instinct is to trigger "sleep" when the display/monitor is powered off and wake when its powered on.

What I'm looking to do is to put a Mac mini/Hackintosh in my car. and I would like to automatically trigger sleep when the car is cut off and automatically wake when cut on.

If any one has a better method of executing this, I'd love to hear suggestions. Thanks

submitted by /u/skye1269
[link] [comments]