Meet posture

MacBook external monitor is a kind of elegant attitude for programmers (manual smile ^ _ ^ | |), apple provides several display modes, including:

  • Extension mode
  • Close cover model
  • Mirror mode
  • Mixed mode

For details about the mode and setting, see The Display mode and setting of Mac External Monitors

Among them, the cover mode is the most widely used, which maximizes the performance of the graphics card and provides the best display effect. However, under the circumstance of high CPU load, the temperature rise of the body will affect the LCD screen to a certain extent, and the keyboard area of the body is also an important part of Mac cooling design.

As shown in the figure above, when the indoor temperature is 23℃ and the CPU occupancy rate is less than 5%, the external 4K display (resolution 2560×1440 30Hz), the CPU temperature is easily above 60℃. It can be seen that the external 4K display is very difficult to test the display performance.

If the heat dissipation problem under the cover mode is avoided, the extended mode will generally be displayed as the main screen, resulting in a long time display of the built-in screen, which is not conducive to the long-term use of the LCD screen. Therefore, how to open the cover of the external display and close the internal screen called “code farmers” a big demand.

Elegant gesture

As for how to open the cover of the external monitor and close the inner screen display, that is, close the GPU driver inner screen display, reduce the performance loss of the graphics card and facilitate heat dissipation, several methods have been given online:

  • The magnet method uses the magnet to deceive the system to automatically terminate the screen, but this method requires the correct location of the magnet, and there is a risk of breaking the screen without taking the magnet to close the cover.
  • Fooling yourself by turning down the display brightness is just turning off the LCD backlight, and the GPU is still driving the display;
  • Modify thenvramSystem configuration This method can close the inner screen graphics card driver in the system driver layer.

The following commands focus on how to modify nvRAM configuration:

sudo nvram boot-args="niog=1"
Copy the code

This command is to close the inner screen under the external display. If the following error occurs:

nvram: Error setting variable – ‘boot-args’: (iokit/common) general error

Command +r To enter the recovery mode, run this command. If the following error occurs:

nvram: Error setting variable – ‘boot-args’: (iokit/common) not permitted

Enter the recovery mode and disable SIP. After setting, connect the external display and power supply, shut down and restart. After entering the user startup page, close the cover immediately and wait for the external display signal to open the cover.

Note: For multiple users, you need to specify the login user to close the cover after startup.

Maintain posture

The following problems may occur when you modify the NVRAM configuration:

  • The screen lights up when the sleep awakens

Close the cover, press the external keyboard or mouse to light the external monitor, press command+F2 on the keyboard (the screen will blink) to open the cover

  • The reason for the failure of the external keyboard is unknown. It may conflict with the touchpad, which needs to be restarted to enter the external display mode

How to enable the inner screen without restarting? Run command+f2 to enter the extended mode, command+f1 to enter the mirroring mode, and then run command+f1 to disable the mirroring mode to enter the extended mode. When the inner screen is opened, the cover can be closed until the sleep display of the system is closed, and then the system is activated by the external keyboard and the cover is opened. At this time, the inner screen is still closed and the inner screen is closed.

How to Restore NVRAM System configuration NvRAM provides specific commands as follows:

sudo nvram -d boot-args
Copy the code

You can run the following command to view specific configuration parameters:

sudo nvram -x -p
Copy the code

How to reset NVRAM can see the official guide to reset NVRAM or PRAM on a Mac

Reference

13 Ways to Turn Off The Screen of Your MacBook Without Closing The Lid [OS X Tips]

How to overcome Error Setting Variable – ‘boot-args’ : (iokit/common) not permitted

How to close the laptop screen and open the cover when using an external monitor for Macbook Pro