7

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?

user63899
  • 71
  • 1
  • 2

2 Answers2

1

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

Cmorales
  • 1,308
  • 14
  • 25
  • 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 09:33
  • I don't know about that, sorry, I haven't use it lately. :( – Cmorales May 26 '12 at 14:50
1

I adjusted myself a script I found to my needs.

You can ignore the wacom commands. Those are just to match the input layer of the tablet to the screen orientation.

#!/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 status file 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.

0x2b3bfa0
  • 8,620
  • 5
  • 38
  • 59
phaeton616
  • 116
  • 1
  • 7