Solutions using Magnets for MacBooks (2015-2019)
There might be many reasons you would want to turn off the built-in display of the MacBook. I am using two larger external monitors, and while using heavy applications if 3 screens are active the Mac starts to throttle. For myself personally, the smaller built-in screen is taking unnecessary resources so just reducing the brightness to zero is not an apt solution. And neither is closing the lid since I was having connectivity problems with my Wifi on the 2.4 GHz channel when the lid was closed and I also want to use the magnificent built-in trackpad for gestures rather than buying an external one.
I was looking at a lot of answers in forums and in this thread but unfortunately, most software-based solutions are outdated and don't work and applications like DisableMonitor say :
It has been reported that the software is able to cause irretrievable damages to your computer.
Use at your own risk!
The project development has been stopped and won't be continued.
I am using a 2019 15" MBP and this solution worked for me. I am hoping this solution would work for all devices in this design platform that Apple used starting from 2015-present (2021).
What you need
We need 2 small low powered magnets. Unfortunately, the magnetic strip used in refrigerator magnets did not work for me.
Magnets that I used were from cheap old IEMs (Earphones), they were perfect since they were relatively low power and I got two of the same size and power.
We are trying to simulate what MacBooks do, to know that the lid is closed.
Two of the many magnets in the display lid in the MacBook in combination with Hall effect sensors in the lower chassis are used by the Mac
to determine when the lid is closed. So all we need to do is place 2 magnets on the lower chassis at the exact location where the two magnets in the display would have been when the lid is closed and voilà it works.
One thing we need to take care of is to place both the magnets at the exact same time otherwise, it doesn't work.
Place the two magnets at the exact same time near the edge of the chassis. For the 2019 15" MBP the location is just below the 2 USB-C ports on either side.
The new Macs do not use any moving parts and especially the hard drives are SSDs, so that concern is for the most part alleviated. Also since the Apple laptops themselves are using magnets to know if the lid is closed it seems to be a safe enough solution as long as it's used when the MacBook is kept stationary and using low-power magnets. Also, I do not see any distortions in the audio while using the built-in speakers as long as the magnets are low in power.
This is one of the only solutions that worked for me which is quite straightforward. Since we are using magnets around computers, I would recommend using as low powered as possible and also check if your computer is using any hardware internal or external which can be affected by magnets (eg, magnetic hard drives) and do after your own research the last thing we want is someone to destroy their work or damage their hardware.