Turn off MacBook Pro's display while connected to external monitor on Yosemite [duplicate]

How do you turn off the MacBook Pro’s display with the lid open while using an external monitor on Mac OS X 10.10 Yosemite?

All the previous methods—such as the one’s listed here—that have worked on Mavericks no longer work on Yosemite.

Does anyone know the way to do this on Mac OS X 10.10 Yosemite? Turning down the brightness is not the same as turning off the display as the GPU still sends a signal to the internal display and the external monitor.

These were the terminal commands to achieve this on Mavericks:

Enable

sudo nvram boot-args="iog=0x0"

Disable

sudo nvram -d boot-args

Anyone know how to achieve this on Yosemite?


Solution 1:

The equivalent command for Yosemite is:

sudo nvram boot-args=niog=1

I've only tested it on my Late 2008 15-inch MacBook Pro, but it works for me. Your mileage may vary.

Source: I read the IOGraphics source code, specifically IOGraphicsFamilyModuleStart() in IOFramebuffer.cpp.

Technical details: We need to clear bit 0 (kIOGDbgLidOpen) in the module's gIOGDebugFlags variable in order to change how it handles lid open events.

Previous versions of the code would set this variable to whatever value iog specified in the boot arguments, or 0x03 if iog wasn't specified.

The code in Yosemite first sets gIOGDebugFlags to 0x43, then bitwise ORs it with the value specified by iog (if it exists), and finally bitwise ANDs it with the bitwise complement of the value specified by niog (if it exists). In other words, iog can now only set bits in gIOGDebugFlags, but the new niog can clear bits. So we specify niog=1 in the boot arguments to clear bit 0.

Solution 2:

Found this wonderful free application :

https://github.com/Eun/DisableMonitor/

Works like a charm. Warning: The app is not in development anymore and warns that it might cause irretrievable dataloss.