Ubuntu – How to toggle between single and dual monitor setup

11.04compizmultiple-monitorsnvidiaxorg

I have two monitors working just right with nvidia driver.

There are times, however, where I want to have just one monitor and other times where I need two: I must open NVidia XServer Settings, go to the XServer Display Configuration and change the second monitor from TwinView to Disabled (and vice-versa).

Is there a way to just toggle that? For example having a shortcut on desktop and/or on the Unity dock? Maybe is there a way to configure a keyboard shortcut to achieve this?

P.s.: I'm using 11.04 with Unity and, of course, Compiz.

Best Answer

Install disper by clicking here or type sudo apt-get install disper in a terminal

Create a new launcher by right clicking on your desktop and selecting "Create Launcher..." Set the name to whatever you want, and the Command to disper -d auto -e

create launcher

Click Ok

Whenever you plug in or unplug your external monitor, just double click the launcher icon.