For those who need a helper card, here's a trick for automate the process in order to disable the "ghost" monitor automatically at login
First, download disable monitor and put in Applications folders (
https://github.com/Eun/DisableMonitor)
Then, run on terminal:
Code:
/Applications/DisableMonitor.app/Contents/MacOS/DisableMonitor -l
It'll return your monitors attached and their IDs:
Code:
ID Name
----------- -----------------
188945589 S22F350
1535231424 Display
----------- -----------------
So, create a file named disable.sh (you can put the name you want), and put this:
Code:
#!/bin/sh
/Applications/DisableMonitor.app/Contents/MacOS/DisableMonitor -d 1535231424
Where -d is for diable a monitor, and then the ID of the "ghost" monitor (labeled purely as "Display" on the results above, NOTE that the real display have the real name)
Save the file at desktop and then change permissions on it: sudo chmod u+x /path/to/the/disable.sh
Then, Get information on the file (select - cmd+i) and set Terminal the default program to open it (i don't know why i have to do that, since the permission are correct)
Then save it on a place where will never touched or accidentally deleted
Create a new plain text file (Textedit), and put:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.loginscript</string>
<key>Program</key>
<string>path/to/disable.sh</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
NOTE THAT YOU HAVE TO CHANGE path/to/disable.sh to your real disable.sh location
and save as com.user.loginscript.plist in ~/Library/LaunchAgents/ (/Users/youruser/Library/LaunchAgents)
then run the follow command on terminal:
Code:
launchctl load ~/Library/LaunchAgents/com.user.loginscript.plist
You can try loggin out and logging in to test if it works.
NOTE: i've one monitor connected to HDMI, when i connect it in the first HDMI port, the system detects three monitors, the ghost one, the real one, and a ghost which is a duplicate from the real one, so if i connect the monitor to the second HDMI port, DisableDisplay show me only the real monitor and the ghost one.
It's a very easy way trick, i've discovered or created nothing, just read the manual for DisplayMonitor and follow this guide:
http://stackoverflow.com/questions/6442364/running-script-upon-login-mac
Hope it works for you