Jump to content

"Detect displays" by command or script?


adaw
 Share

8 posts in this topic

Recommended Posts

hello everyone,

I use JaS 10.4.8 (kernel 8.8.1) on my laptop Dell Latitude d510 (intelGMA900) and everything works perfectly thanks to all the amazing tutorials and help i've got from this forum. In order to get my GMA900 working, i had to use the wire trick, which leads me to a new problem: once the laptop has boot, i see 2 displays in the system preferences, which is not a BIG deal, but this 2nd display slows down the performance a little (it's obvious when i use the virtuedesktop transitions, the animation is sluggish...)

So right now, i have to click on "detect display" (in the display part of the system preferences) everytime i start my computer, so only the main display remains active (and then the performances are back).

Is anyone aware of a command, or a script i could add to my startup? (or my rc.local)

Any help appreciated ;)

Link to comment
Share on other sites

so, noone knows how i could refresh my displays list without using the system preferences? :(

i've been looking for a command for some time now, but it seems it simply doesn't exist!

best regards

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Ok, after finding the answer to my mirroring problem (same sort of area in Display Preferences) here's the Apple Script that should help you (Also attached a copy of the script and application in zip format just incase the forum messes it up):

 

activate application "System Preferences"

tell application "System Events"

tell application process "System Preferences"

tell window 1

click button "Show All" of group 1 of group 2 of tool bar 1 (* in case another pane is already open *)

tell button "Displays" of scroll area 1

repeat until exists (* wait until the object is accessible *)

delay 0.2

end repeat

click

end tell

tell button "Detect Displays" of group 1 of tab group 1

repeat until exists (* wait until the object is accessible *)

delay 0.2

end repeat

click

end tell

end tell

end tell

end tell

tell application "System Preferences" to quit

DetectDisplay.zip

Link to comment
Share on other sites

Also been playing about trying to make a faster version on the script by opening the Displays directly, but there still had to be manual delays added to wait for the window to appear... (If I find a repeat until document open then it should fly!)

 

tell application "Finder"

open document file "Displays.prefPane" of folder "PreferencePanes" of folder "Library" of folder "System" of startup disk

delay 0.5

tell application "System Events"

tell process "System Preferences"

tell button "Detect Displays" of group 1 of tab group 1 of window "Display" to click

end tell

end tell

end tell

tell application "System Preferences" to quit

Link to comment
Share on other sites

 Share

×
×
  • Create New...