Apple - Turn off MacBook Pro's display while connected to external monitor on Yosemite
Found this wonderful free application :
https://github.com/Eun/DisableMonitor/
Works like a charm.
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.
Finally someone who realized a free app to disable monitors: DisableMonitor (on GitHub)