Remember window sizes and placement when unplugging and replugging second monitor
Here’s something that sucks:
- Plug in external monitor to laptop (Mac OS X Leopard in my case).
- Arrange your windows to have the IDE on one screen and browser on another. (Etc etc. Resize, rearrange, fuss, fuss, fuss.)
- Unplug monitor to run to a meeting, or whatever.
- Goto 1.
I’d like to replace step 2 with “computer remembers exactly how I had it and just puts it back that way”.
(I personally only need a solution for Mac but collecting solutions for other systems here might be useful to others. I’m sure it’s a common problem.)
Solution 1:
Have a look at Stay by Cordless Dog. I believe it does exactly what you're looking for.
Solution 2:
Slate is a very powerful free Mac app that does exactly what you want. When you plug in your secondary monitor, it automatically detects the new monitor, and all of your windows will be moved and resized just the way you like them. You can define custom positions and sizes for all of your applications, including full screen, half screen, and grid-based.
One of the coolest things about Slate is that you can define different layouts based on how many monitors you have connected. For example, if you are using your laptop by itself, you might want to have all of your apps filling the whole screen. But when you have a larger secondary monitor, you might want to split up your screen between your browser, mail, and music. Slate does this easily.
You can also define keyboard shortcuts for specific layouts and actions such as nudging and resizing windows by a certain percentage.
Below is my configuration file. I keep all of my apps at full screen on all of my monitors, but you can change it to make them half or some other size:
# Monitor Aliases
alias mon-laptop 0 # variable for my laptop monitor
alias mon-hp 1 # my external HP monitor
# Window Position Regions
alias hp-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${mon-hp}
alias hp-left move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${mon-hp}
alias hp-right move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${mon-hp}
alias laptop-full move screenOriginX;screenOriginY screenSizeX;screenSizeY ${mon-laptop}
alias laptop-left move screenOriginX;screenOriginY screenSizeX/2;screenSizeY ${mon-laptop}
alias laptop-right move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY ${mon-laptop}
alias laptop-righttop move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY/2 ${mon-laptop}
alias laptop-rightbottom move screenOriginX+screenSizeX/2;screenOriginY+screenSizeY/2 screenSizeX/2;screenSizeY/2 ${mon-laptop}
# Window layouts for when I have 2 monitors
layout 2monitor 'Google Chrome':REPEAT ${hp-full}
layout 2monitor 'iCal':REPEAT ${hp-full}
layout 2monitor 'Coda':REPEAT ${hp-full}
layout 2monitor 'Mail':REPEAT ${laptop-full}
layout 2monitor 'Rdio':REPEAT ${laptop-full}
layout 2monitor 'Spotify':REPEAT ${laptop-full}
layout 2monitor 'Evernote':REPEAT ${laptop-full}
# Single monitor window layouts
layout 1monitor 'Google Chrome':REPEAT ${laptop-full}
layout 1monitor 'iCal':REPEAT ${laptop-full}
layout 1monitor 'Coda':REPEAT ${laptop-full}
layout 1monitor 'Mail':REPEAT ${laptop-full}
layout 1monitor 'Rdio':REPEAT ${laptop-full}
layout 1monitor 'Spotify':REPEAT ${laptop-full}
layout 1monitor 'Evernote':REPEAT ${laptop-full}
# Keyboard shortcuts for each layout
bind l:shift;ctrl layout 2monitor
bind g:shift;ctrl grid padding:5 0:2,1 1:2,2
# Auto-detect when a monitor is plugged in or out
default 2monitor count:2
default 1monitor count:1
Here is the list of features from Slate's GitHub page:
- Highly customizable
- Bind keystrokes to:
- move and/or resize windows
- directionally focus windows
- activate preset layouts
- create, delete, and activate snapshots of the current state of windows
- Set default layouts for different monitor configurations which will activate when that configuration is detected.
- Window Hints: an intuitive way to change window focus
- [Beta] A better, more customizable, application switcher.
Here is a great tutorial on how to get the most out of Slate.