My first attempt to run el capitan 10.11.0 on one of my macintoshes is with a mac mini using a dual monitor setup.

There is one HDMI monitor Samsung Syncmaster and one DVI monitor Medion MD20429 connected via the display port with an adapter.

After getting back from sleepmode the second monitor (DVI) does not come up by itself. In system setup / monitor it does not show and only if i use the option key and click detect monitors (see e.g. http://osxdaily.com/2014/03/31/detect-displays-mac-os-x/) will it come back.

My OS 10.9.5 Mavericks computers do not show this unwanted effect.

  • How can this El Capitan behavior be avoided?
  • Is there at least a one-click workaround somewhere?
  • is this a known bug to Apple?
  • Please add some detail about the Mac, the connection methods and adaptors in use and the monitor manufacturer(s). In my Mac Mini (mid-2011) setup, I have a BenQ 27" connected via HDMI and a Dell 2009W connected via MiniDisplayPort/DVI adaptor. – IconDaemon Dec 22 '15 at 12:43
  • Can't you just click the Option key to toggle between the "Gather Windows" and "Detect Display" button in the Display preferences? – user173474 Feb 29 '16 at 18:34
  • Thats what I'd like to avoid: having to manually start the system preferences ... – Wolfgang Fahl Mar 2 '16 at 9:08

This is a two part workaround:

  1. an applescript to click on the detect monitor
  2. a bash script to run the script

I "saved" the applescript to $HOME/source/detectmonitor.scpt (see Run AppleScript from bash script) how to work around the issue that you can not really start with a text file ...

Then I saved the bashscript to $HOME/dm

I created a symbolic link ln -s $HOME/Desktop/detectMonitors $HOME/bin/dm

and set my Terminal preferences according to https://stackoverflow.com/a/8822669/1497139

now i can double click "detectMonitors" on my Desktop to work around the issue.

Applescript to click "detect monitor" in monitor system preferences

see https://stackoverflow.com/questions/12640643/applescript-to-run-detect-displays

-- Script to click the "Detect Displays" button
-- 2015-12-22 WF
-- see https://stackoverflow.com/questions/12640643/applescript-to-run-detect-displays
-- adopt to your language settings by setting the right button name below
-- currently this is german "Monitore erkennen"
-- to create and run this script you need a compiled scpt file to begin with see
-- https://apple.stackexchange.com/questions/103621/run-applescript-from-bash-script
-- then you also need to set the security settings
tell application "System Preferences"
    reveal pane "com.apple.preference.displays"
end tell

delay 0.5

tell application "System Events"
    tell process "System Preferences"
        try --don't even consider not using a try block!
            key down option
            delay 0.5
            --click button "Detect Displays" of window 1
            click button "Monitore erkennen" of window 1
            delay 0.5
            key up option
            tell application "System Preferences"
            end tell
        on error errMsg --logging out is the only other way to clear these
            key up option
            display dialog "ERROR: " & errMsg
        end try
    end tell
end tell

Bash-Script to run the applescript

# WF 2015-12-22
# run detect monitors
cd $HOME/source/applescript
osascript detectmonitor.scpt
# set Terminal settings
# according to https://stackoverflow.com/a/8822669/1497139
# to get this to close your terminal window
exit 0
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .