Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an extra monitor hooked up to my iMac running Snow Leopard. This additional monitor is also used by my linux box, so I occasionally switch to VGA mode when I need to use the linux box.

My question is, how can I get OS X to quickly move to single monitor mode? You get the effect I'm looking for when you unplug the second monitor's mini DV plug - OS X will move all applications to the main monitor.

I'm looking for a programatic solution that I can map to a keyboard shortcut.

Any thoughts on this?

share|improve this question

migrated from Jan 17 '12 at 6:13

This question came from our site for professional and enthusiast programmers.

Is the effect you want mimicked by "Gather Windows" in the Displays preferences pane? If so, you might have luck with a script similar to Or, perhaps,

share|improve this answer
I REALLY like the first solution. The second one simply calls gather windows which doesn't actually move my applications to the main display. However, the first solution doesn't seem to work. I've enabled access for assistive devices but it keeps reporting that I haven't. – Jason Palmer Jan 16 '12 at 17:48
Not sure if you need a reboot after enabling assistance? – Adam Wright Jan 16 '12 at 20:30
Was already enabled when I looked – Jason Palmer Jan 17 '12 at 4:28

For those having the same issue, I have found the solution that works for me:

share|improve this answer

You must log in to answer this question.