thenanodude
August 22nd, 2012, 05:53 PM
I have a Dell Lattitude E6420 and a Dell E-Port docking station. I had some trouble initially getting my external DVI monitors to work when the laptop was plugged into the E-Port, but I eventually figured out that I needed to disable the Optimus support in the BIOS. Now, with Optimus support disabled, one of my external monitors is automatically detected when plugged in. I can run nvidia-settings to enable the second monitor after I log in, but this is sort of a pain to do every time, and I'm thinking there must be an automatic way to enable this.
The solution seems straightforward: at some point in the boot up or login process, check to see if the laptop is docked, then if it is, run nvidia-settings or xrandr to enable both monitors. The problem is this: I cannot figure out how to determine whether the laptop is docked. I have seen three solutions:
1. look in /sys/devices/platform/ for "dock" files. (https://sites.google.com/site/moosyresearch/thinkpadt61x#TOC-Udev-dock-events)
However, these files do not exist in this folder or any others I can find.
2. look in /proc for devices that only exist when docked (http://superuser.com/questions/90657/find-out-if-laptop-is-docked-in-linux). The suggested command to do this is `tail -1 /var/run/stab | cut -d ":" -f 1`
However, the file /var/run/stab does not exist.
3. use xrandr -q (http://it-tactics.blogspot.com/2010/08/ubuntu-1004-with-docking-station.html).
However, this does not seem to return the useful information as indicated in the blog post.
So, the question is: how can I automatically determine whether my laptop is docked?!
With some poking, I can probably figure out the answer to the next question, but if anybody has a quick answer, I would appreciate it: Once I determine the laptop is docked, how do I use nvidia-settings or xrandr to enable the second display?
incidentally, when docked, 'xrandr -q' returns:
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1600 x 900, current 3200 x 900, maximum 3200 x 900
default connected 3200x900+0+0 0mm x 0mm
1600x900 50.0 51.0
3200x900 51.0*
also, after I use nvidia-settings to enable the second monitor, it will save an xorg.conf (I know this isn't used any more) configuration with the relevant sections:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "NVS 4200M"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP-0: NULL, DFP-1: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +1600+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
The solution seems straightforward: at some point in the boot up or login process, check to see if the laptop is docked, then if it is, run nvidia-settings or xrandr to enable both monitors. The problem is this: I cannot figure out how to determine whether the laptop is docked. I have seen three solutions:
1. look in /sys/devices/platform/ for "dock" files. (https://sites.google.com/site/moosyresearch/thinkpadt61x#TOC-Udev-dock-events)
However, these files do not exist in this folder or any others I can find.
2. look in /proc for devices that only exist when docked (http://superuser.com/questions/90657/find-out-if-laptop-is-docked-in-linux). The suggested command to do this is `tail -1 /var/run/stab | cut -d ":" -f 1`
However, the file /var/run/stab does not exist.
3. use xrandr -q (http://it-tactics.blogspot.com/2010/08/ubuntu-1004-with-docking-station.html).
However, this does not seem to return the useful information as indicated in the blog post.
So, the question is: how can I automatically determine whether my laptop is docked?!
With some poking, I can probably figure out the answer to the next question, but if anybody has a quick answer, I would appreciate it: Once I determine the laptop is docked, how do I use nvidia-settings or xrandr to enable the second display?
incidentally, when docked, 'xrandr -q' returns:
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1600 x 900, current 3200 x 900, maximum 3200 x 900
default connected 3200x900+0+0 0mm x 0mm
1600x900 50.0 51.0
3200x900 51.0*
also, after I use nvidia-settings to enable the second monitor, it will save an xorg.conf (I know this isn't used any more) configuration with the relevant sections:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "NVS 4200M"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP-0: NULL, DFP-1: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +1600+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection