DisplayWatcher is a neat Mac OS X application that helps you change your dock (and other) settings automatically when you plug/unplug an external monitor by invoking AppleScripts upon display changes. It also has the ability to run scripts upon return from sleep mode (always nice for those SSH tunnels).:

See Also: