Disable the Internal Screen on a MacBook Pro or Air in OS X Yosemite & Mavericks
Some MacBook Pro or Air users may want to disable their internal screen when the laptop is connected to an external display, this is generally achieved in two ways but ever since Mac OS X 10.7, 10.8, and 10.9, OS X 10.10 Yosemite, and OS X 10.11 El Capitan, the internal screen is more persistent and wants to stay on.
That display behavior can be modified with a terminal trick to allow for disabling the built-in screen on a MacBook Air or MacBook Pro, but it’s somewhat advanced and thus should only be used by users who have a comfort level with modifying OS X at a system level. Always back up your Mac before making modifications to the core system functionality.
Disable the internal screen for OS X Lion, Mountain Lion, and OS X Mavericks based Mac laptops
Launch the Terminal and enter the following command:
sudo nvram boot-args="iog=0x0"
You’ll need to reboot for changes to take effect, and the internal display will then be completely disabled regardless of whether the Mac is open or closed.
To undo this, you can go back to the Terminal and enter:
sudo nvram -d boot-args
Then reboot again, or you can just zap PRAM by holding down Command+Option+P+R during reboot, which clears out the boot-args as well. If you were to disconnect the MacBook Pro from an external video source, zapping the PRAM would be how you’d want to reenable the internal display.
Disable the Internal Laptop Display in OS X Yosemite & OS X El Capitan
For OS X Yosemite (10.10) and OS X El Capitan 10.11, the solution is similar but using slight variations on the aforementioned terminal command.
To turn the feature on and allow for the internal screen to be
sudo nvram boot-args="niog=1"
After executing the terminal command, reboot and close the lid immediately. Keep the lid closed during boot up, and once logged in to a user account in OS X, open the lid. The MacBook Pro (or Air) internal built-in display will now be off.
**Note: If in sleep mode, just close the lid before waking the MacBook Pro and open the lid once again after logging back in.
To undo and return to normal display behavior:
sudo nvram -d boot-args
Similar to prior versions of OS X, resetting the PRAM can also disable the setting. Thanks to Keefe for the tip specific to OS X Yosemite.
This is the opposite of “clamshell mode” – where the Mac laptop is closed and the screen is still turned on. Clamshell can look nice, but without adequate air flow the Mac may overheat, thus running the computer with the display open is recommended. If you’re going to do this, be sure to set the primary display so that the menubar, Dock, and alert windows go to the proper screen.
Thanks to Marcus for the tip via a thread on Apple Discussions