Macbook Pro on battery – lid closed without issue

I’ve used Macbook Pro for years now, and up until I picked up my latest 2017 Macbook Pro I never worried about having external monitors.  It wasn’t until an incident with my iMac having a video module go out that I figured It’d be best just to have one computer for everything.  That’s when I picked up the latest 15 inch Macbook Pro, and dual monitors plugged in with HDMI to USB-C adapters.  (MUCH sweeter than previous setups on systems)  The biggest problem I ran into was not being able to close my laptop screen with the external monitors attached, without the system going into standby mode.  Before anyone says anything, the heat is expelled through the bottom on left and right openings to avoid the monitor being closed being an issue.

Up until MacOS High Sierra came out, I was using a 3rd party application called InsomniaX to keep the system from sleeping when the lid was closed.  It’s a great application, but for some reason stopped disabling lid sleep on battery when I installed High Sierra.  Problem.  After research, I found the easiest way is to run the following as admin in the terminal:
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1

The following simply sets sleep time to 0, and disables sleep.  Since I use terminal quite a bit (I’m a Unix engineer), I put the following into ~/.bash_profile:
alias sleepoff=’sudo pmset -b sleep 0; sudo pmset -b disablesleep 1′
alias sleepon=’sudo pmset -b sleep 5; sudo pmset -b disablesleep 0′

With that, it’s easy enough to just type “sleepoff” at the prompt instead of the whole line… and if you want to enable sleep capabilities then type “sleepon”.

Anyway, not a breakthrough in science but it does fix a gripe.  Hope it helps someone.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.