Prevent StandBy closing MacBook lid during no power connection but Display connected I have currently no power connection to my MacBook Air, but I have a Display connected. I want to close the lid and only work on my external display.

So I want to prevent my MacBook going to StandBy when I close the lid. When I have the power cable connected, it will just switch to the bigger screen. But when the connector isn't attached, it will go to sleep.


  How to prevent going to StandBy if no power connector is attached? Any
  app or terminal command?


I am running OS X Yosemite on a MacBook Air mid-2011.
NoSleep prevents sleep when lid is closed.