Install xbindkeys:

sudo apt-get install xbindkeys xbindkeys-config

Get this python script:

and place it e.g. in ~/bin

Make it executable:

chmod +x aticonfig_switch.py

Now run:

xbindkeys-config

and bind the script to a key kombination. I use Winkey+S.

The next time you resume after having docked or resuming in the dock you just wait to the login dialog comes up (the one you cannot see :-P), type in the password and press the key kombination. You should now get the screen to your monitor after a couple of seconds.

Source: http://cpbotha.net