Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using a Thinkpad T510 and I often boot it in a ThinkPad Mini Dock Plus Series 3 (EU). The problem is that if I boot it with the lid closed, I can see grub, I can see the Ubuntu boot splash, but after that my external monitor (connected via VGA) turns off, and I have to open the lid and tell the NVIDIA driver manually to use the external screen and turn off the built in LCD panel. Is there a way to put it into an udev rule, or something like that to avoid the manual switching?

share|improve this question

2 Answers 2

There are some tools to automate it like RandR, disper, displex or this one http://gnomefiles.org/content/show.php/Laptop+external+display+hotplugging?content=138742

share|improve this answer
1  
Ok, disper solved my problem, but only partially. I can not see my login screen (I guess thats a problem with lightdm), but after I type in my password, it changes to the second monitor. How can I get the login screen to be displayed on the external monitor? –  user63899 May 25 '12 at 9:33
    
I don't know about that, sorry, I haven't use it lately. :( –  Cmorales May 26 '12 at 14:50

i adjusted myself a script i found to my needs.

you can ignore the wacom commands for this is just to match the inpult layer of the tablet to the creenorientation.

#!/bin/bash
#!/bin/sh
# wait for the dock state to change
sleep 2.0
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
case "$DOCKED" in
    "0")
       #undocked event - lets remove all connected outputs apart from LVDS
       for output in $(/usr/bin/xrandr -d :0.0 --verbose|grep " connected"|grep -v LVDS|awk '{print $1}')
         do
         /usr/bin/xrandr -d :0.0 --output $output --off
       done
    xrandr --output LVDS1 --rotation normal
        xsetwacom set "Wacom ISDv4 90 Pen stylus" MapToOutput LVDS1
    xsetwacom set "Wacom ISDv4 90 Pen eraser" MapToOutput LVDS1
    # rotates the tablet input to the according position (half=180°, (c)cw=(counter)clockwise, none=normal)
    xsetwacom set "Wacom ISDv4 90 Pen stylus" rotate none
    # if multiouch present set: xsetwacom set "Wacom ISDv4 E6 Finger touch" rotate half
    xsetwacom set "Wacom ISDv4 90 Pen eraser" rotate none
    ;;
    "1")
    ## rotates internal Laptop Display LVDS1 to inverted
    xrandr --output HDMI2 --auto --above LVDS1
    xrandr --output LVDS1 --rotation inverted
    xsetwacom set "Wacom ISDv4 90 Pen stylus" MapToOutput LVDS1
    xsetwacom set "Wacom ISDv4 90 Pen eraser" MapToOutput LVDS1
    # rotates the tablet input to the according position (half=180°, (c)cw=(counter)clockwise, none=normal)
    xsetwacom set "Wacom ISDv4 90 Pen stylus" rotate half
    # if multiouch present set: xsetwacom set "Wacom ISDv4 E6 Finger touch" rotate half
    xsetwacom set "Wacom ISDv4 90 Pen eraser" rotate half
    ;;
esac
exit 0

It identifies a statusfile in /sys/devices/platform/dock.0 wheter it has the value 1 for docked or 0 for undocked an triggers xrandr to adjust the display output to an extended dektop using the inbuilt display LVDS1 an configuring the external display HDMI2 above.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.