How to turn off MacBook's internal display with external one connected? [duplicate]

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.

Solution 3:

I have a magnet iPhone case, I put it near my old macbook's keyboard, near the ASDF keys, and the internal screen turns off immediately! It's so simple!

Credit to http://www.cultofmac.com/176329/turn-off-internal-lcd-display-of-your-macbook-air-os-x-tips/

Edit: You have to connect your macbook to a power adapter to make this method working.