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?
ctypesand 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 08:18