Automatically change resolution when not in dock
Posted
by
jwir3
on Ask Ubuntu
See other posts from Ask Ubuntu
or by jwir3
Published on 2012-10-09T21:12:38Z
Indexed on
2012/10/09
21:58 UTC
Read the original article
Hit count: 189
I have Ubuntu 11.04 (yep, I know it's old news) on my Lenovo W520. At home, I have a dock with dual monitors. I have a pretty decent setup - things work almost perfectly (hence the reason I'm reluctant to upgrade... that and I'm not 100% sold on Unity).
Anyway, the only annoyance I have is that when I'm on travel, I use the laptop screen. When I un-dock the laptop, I need to manually go into nvidia x-server settings and change the resolution from 'Auto' to 1920x1200, or it will think I have two screens, and my mouse pointer will be able to go way off the left side of the screen. This isn't a big deal, but I need to do it every time I restart the x-server (so if I reboot, or have to kill it, etc...)
What would be really nice is if there was a way for it to automatically detect whether or not there is external monitors (which it seems to do already), and switch into the mode I select, depending on which monitors are connected. Is there any way to accomplish this? I've posted my xorg.conf file for reference.
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 270.29 (buildd@allspice) Fri Feb 25 14:42:07 UTC 2011
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 275.19 ([email protected]) Tue Jul 12 18:35:38 PDT 2011
#Section "Monitor"
# Identifier "Monitor1"
# VendorName "Lenovo"
# ModelName "ThinkpadLCD"
# #HorizSync 28.0 - 33.0
# #VertRefresh 43.0 - 72.0
# #Option "DPMS"
#EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL U2410"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro 1000M"
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
Section "Screen"
# Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+120, DFP-6: nvidia-auto-select +1920+0"
# Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+120, DFP-5: nvidia-auto-select +1920+0"
# Removed Option "metamodes" "DFP-0: nvidia-auto-select +1920+419, DFP-5: nvidia-auto-select +3840+0, DFP-6: nvidia-auto-select +0+0"
# Removed Option "metamodes" "DFP-5: nvidia-auto-select +0+0, DFP-6: 1920x1200 +1920+0"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "NoLogo" "True"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "TwinView" "1"
Option "metamodes" "DFP-5: nvidia-auto-select +1920+0, DFP-6: 1920x1200 +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
© Ask Ubuntu or respective owner