I use my laptop with a second display. Sometimes I should take my laptop with me, but I can't take my second display with me. How can I setup my ubuntu 10.04 so that it changes the resolution automatically when I disable the second display?
My normal resolution (with the second display) is 2646*800. My resolution without the second display (laptop resolution) 1280*800.
What I want is:
- When i disable second display, my resolution automatically (or by running some script) changes to 1280*800
- When i connect second display resolution change to 2646*800.
You can use xrandr (assumming your driver supports it), for a nice guide check http://www.ubuntugeek.com/how-change-display-resolution-settings-using-xrandr.html .
A simple way to use
xrandr
is with--preferred
to use the detected settings.Run
xrandr
to get the names of your outputs (I use LVDS1 and VGA1 below) and then you can use something like the following:This is the script I use: