Over the years, I've noticed that there's one "drawback" to multiple heads/screens on a laptop workstation. I get in the habit of arranging my workspace how I like it, where eventually I have 8-10 windows in positions I would prefer to be permanent whenever I hook up my external 2 heads. When I undock, of course everything collapses back to my main display. When I re-dock, the windows remain in a cluttered pile on my main screen. In addition to this, changes in resolution can result in windows needing to be re-sized as well.
I've found one or two utilities over the years that have allowed me to save window positions and sizes, but nothing that handled it for me as automatically as I would have liked. So I wrote my own in AutoHotKey: the Muchtall Window Arranger.
It's fairly simple, yet powerful if you want it to be. Since it's written in AutoHotKey, you can write custom filters to apply to your window rules (assuming you know AHK). But, for the casual user, it simply grabs the active window information and allows you to alter the conditions that apply to the window matching before saving those settings.
Downloadfrom GitHub: Muchtall Window Arranger
You must have AutoHotKey installed before using this script.
There's one setting in the source you'll probably want to modify before you get started. The variable "NumberOfScreens = 3" should be changed to the number of heads you want to have activate the auto-rearrange feature. If this is set to something higher than you'd ever have installed (say 10), the auto-rearrange feature should never activate.
I'll probably clean up the rough edges as I get feedback on it. I know there may be some use for features like re-arranging for multiple head settings, so there's work to be done.
Edit: Moved code to GitHub repo