When being at my workplace at home, I like to use an external monitor instead of the laptop display (Acer TravelMate 5730G). I did not always want to open up the display control in Kubuntu in order to change between between primary (laptop) and secondary (external monitor) device. I came up with two small scripts which perform the switching in both directions. One is shown below, the other one is analogous.
|
xrandr --output LVDS --crtc 0 --auto --output VGA-0 --auto sleep 0.5 xrandr --output LVDS --crtc 0 --auto --output VGA-0 --off |
This effectively switches on both displays and then disables VGA-0. You can find out about your connectors’ names by running xrandr without arguments or xrandr –verbose which also gives you the CRTC number (supported controllers) which needs to be set manually sometimes (see line CRTCS in the verbose output).
However, recently I noticed there is a more reliable tool called disper which has been developped for facilitating the monitor management with Nvidia graphics cards. Yet, it also works perfectly for my ATI mobile Radeon HD 3650 graphics chip.
The package can be installed from the regular Ubuntu repositories:
|
sudo apt-get install disper |
Afterwards you may easily switch monitors with one short command as the help (disper –help) suggests:
|
-l, --list list the attached displays -s, --single only enable the primary display -S, --secondary only enable the secondary display |
The primary (secondary) display is the first (second) display returned by –list. On my machine, neither cloning (–clone) nor extending the display (–extend) work properly, unfortunately.
Links
- [1] Short intro on disper in the ubuntuusers Wiki (German)