# Have second window with different perspective open only when a second monitor is connected?

I have Blender on my laptop, into which I sometimes plug an external monitor, and set up some different regions to make my workflow smoother/easier.

When I save and close my project, the multiple windows are saved as expected. However the next time I open Blender, I might not have my second monitor connected, and both windows will be forced onto one display. Is there a way to detect if my second monitor is connected when I open a project, and automatically get rid of the extra window when it is not?

• You might be able to use some kind of python script to do this – gandalf3 Apr 16 '15 at 22:39
• In python you might want to use ctypes and call system libraries to get information about the connected monitors. A quick search on google revealed an example script to get the resolution of all connected monitors (and thus the monitor count) here. In linux you will probably have to call some X11 library instead of the user32.dll – maddin45 Apr 17 '15 at 8:18
• this might interest you – sambler Apr 18 '15 at 14:57