Configuring the resolution on a Laptop Docking Station
I have a Dell Inspiron 8200 that I use with a “docking station”, in my office. It allows me to connect to my external 17″ monitor, keyboard and mouse. The resolution on my laptop is 1600X1200 and the resolution on the monitor is 1280X1024. The issue I was experiencing was when I connected my laptop to the docking station, the laptop would push the 1600X1200 resolution to the monitor giving me a blank screen.
I wrote a short script that detect which monitor is currently active and adjust for supported resolution.
Detecting the monitor
To start off we are going to need to get the system name of the external monitor. Connect your laptop to the docking station and start ubuntu. (If your resolution is not compatible with your external monitor you might have to disconnect it from the docking station and adjust the resolution manually prior to connecting to the docking station). In Terminal type the following:
sudo get-edid 2>/dev/null | parse-edid 2>/dev/null | grep Identified
When I ran the above command I got the following:
ctx pv720
Great! Now we know the system name of our external monitor. You will also need to determine the optimal resolution for your external monitor before continuing. You might have to check the documention that came with your monitor or check online.
We are now going to write the AmIDocked.sh script:
sudo gedit /etc/X11/AmIDocked.sh
Copy the following to the AmIDocked.sh file you just created. Remember to replace “ctx pv720″ with the name of your monitor!
#!/bin/sh
# Checks the attached monitor using the read-edid package
# and links the appropriate xorg.conf
# Can be used to detect docked and undocked state if an external monitor is used while docked
# String to look for in the *docked* state
# As root use the following command to determine what to use
# get-edid 2>/dev/null | parse-edid 2>/dev/null | grep Identified
MONITOR=”ctx pv729(replace with your monitor name )”
# Is the 24″ Flat Panel attached?
AMIDOCKED=`get-edid 2>/dev/null | parse-edid 2>/dev/null | grep Identifier | grep “$MONITOR” | wc -l`
echo -n “Setting correct Screen(s) configuration: ”
if [ "$AMIDOCKED" -ge 1 ] then
ln -sf /etc/X11/xorg-docked.conf /etc/X11/xorg.conf
# Add additional lines for other tasks for *docked* state
else
ln -sf /etc/X11/xorg-undocked.conf /etc/X11/xorg.conf
# Add additional lines for other tasks for *undocked* state
fi
This script will be able to determine if your laptop is connected to the docking station. Save the file and exit.
We are now going to write the xorg-docked.conf script:
sudo gedit /etc/X11/xorg-docked.conf
Section “Monitor”
Identifier “CTX PV720”
Option “DPMS”
HorizSync 28-64
VertRefresh 43-60
EndSection
Again ensure that you replace “CTX PV720″ with the name of your monitor.
We are now going to add the resolution information about the external monitor:
Section “Screen”
Identifier “Default Screen”
Device “NVIDIA Corporation NV11 [GeForce2 Go]”
Monitor “CTX PV720″
DefaultDepth 24
SubSection “Display”
Depth 1
Modes “1280×1024”
EndSubSection
SubSection “Display”
Depth 4
Modes “1280×1024”
EndSubSection
SubSection “Display”
Depth 8
Modes “1280×1024”
EndSubSection
SubSection “Display”
Depth 15
Modes “1280×1024”
EndSubSection
SubSection “Display”
Depth 16
Modes “1280×1024”
EndSubSection
SubSection “Display”
Depth 24
Modes “1280×1024”
EndSubSection
EndSection
Script xorg-undocked.conf
We are now simply going to copy our xorg.conf file and rename it to xorg-undocked.conf file so that our script (AmIDocked.sh) can find it.
sudo mv /etc/X11/xorg.conf /etc/X11/xorg-undocked.conf
Now give it a try!
Enjoy
Nadia



Yo quiero una asi! jejejeje..