How to automatically turn black main monitor when external monitor is connected while using internal keyboard [duplicate]

I went through a similar question, but the answer was informing how to hide the monitor, but not how to disable it.

I do not want any new windows to creep into the laptop display when the external display is connected. I could not find any in the Display Settings (under System Preferences).

I don't want to close the lid because I think it impacts the air flow of the MacBook Pro.

I don't want to close the lid because the sound quality is reduced.


Reducing heat by adjusting the lid

Having the lid closed or open does not impact the airflow of your MacBook Pro (MBP). Ambient air is never in short supply and the "exhaust" (where the hot air picked up by the blade fan(s) are expelled) is located at the back of the unit (the black stripe on the newer models and the grey stripe on the first generation machines).

Some claim that keeping the lid open allows the chassis to cool down, but these claims have never had any real data behind them (simply anecdotal evidence and unsubstantiated rumour). Personally, I have a 2006 MBP that was eventually relegated to being a desktop. I ran the system for well over a year with the clamshell open, and then closed, and saw no different in CPU/CPU temps (nor any variability in the other heat sensors) as a result. Moreover, the newer models have far more efficient blade fans and would suffer even less from the effects of heat (additionally, the new Intel chipsets run cooler than their predecessors). You can conduct your own testing of course. I had replaced the heat sink, re-applied a sane amount of Arctic Silver thermal paste, and used Lobotomo Fan Control daemon to monitor my system's temperature.

Disabling the internal display, properly

There are two ways to connect a secondary display to your notebook without enabling the default screen (note that this does not mean dimming it, but rather turning it off).

  1. The first is to connect the display with the lid closed when the machine is powered down. Once the external display is connected, turn the machine on—it will detect the secondary display while leaving the internal one turned off. This will alleviate the issues you have with "dragging things off the screen" as the system will constrain your desktop to the one, active monitor.
  2. The second is to connect the secondary display when your system is awake and active, and the clamshell open. Make sure the notebook is plugged in. Once you connect the secondary monitor, the system will recognize it. Once it does, close the lid on your notebook. The device will be put to sleep. Once that happens, move your mouse, or hit a key on your keyboard to wake it. Once it wakens, it will enable the secondary display, but not the internal one.

Additionally, you may set the attribute to leave the system in the sleep state even if the clamshell is opened. You can do this using pmset, a local utility found on OS X that actually handles all your power settings. You can accomplish this with the following command:

sudo pmset -a lidwake 0

The -a, -b, -c, -u flags determine whether the settings apply to battery ( -b ), charger (wall power) ( -c ), UPS ( -u ) or all ( -a ).

To reverse the command, set the 0 to a 1. These settings are persistent, in that, they do not need to be re-applied every time the machine's power is cycled and are saved to the file: /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist


You could also use a ThirdParty App like https://github.com/Eun/DisableMonitor/

Edit:

DisableMonitor adds the missing feature to disable a monitor on a Mac. You can also easily disable, enable or change the resolution of a monitor. enter image description here


My suggestion is to set the displays to 'mirror' then turn the brightness down on your Mac.

Both your screens are the same so you won't lose any windows.