External displays Thinkpad Pro Dock 90w stay switched off after resume

Last week i did a lot of testing with Kubuntu wily 15.10 and xenial 16.10 ( dev ) on Lenovo Thinkpad T450s and Thinkpad Pro Dock 90w. So one of the main problems i found was that external displays stay switched off after resume.

After a lot of debugging kernel and Intel driver stuff i resulted that this a bug from the dock, cause external displays worked fine plugged in the laptop. ( All firmware were upgraded on the newest stage possible).

I finally followed the instructions at:

http://www.niemueller.de/blog/id/249

with a small change with his final $HOME/bin/resume.sh script.

#!/bin/bash

PORT=DP2-2
DOCKED=$(cat /sys/devices/platform/dock.0/docked)

if [ "$DOCKED" != "1" ]; then exit 0; fi

export DISPLAY=:0
export XAUTHORITY=/home/rschetterer/.Xauthority

if (xrandr -q|grep $PORT|egrep -qv disconnected); then
       xrandr --output $PORT --off
       sleep 1
       #xrandr --output $PORT --preferred
       /home/rschetterer/.screenlayout/docked.sh
       exit 0
fi

exit 1

The script /home/rschetterer/.screenlayout/docked.sh

can be easily semi auto produced by arandr

Final Words: This is only a workaround ,i found older solutions posted somewhere in WWW with i.e acpi, udev, pm-utils but they did not longer work on wily and xenial.

UPDATE

I have tested this workaround with Xenial 16.04 Kubuntu Beta, cause all other tests failed with two external displays attached at resume.

create

/etc/systemd/system/thinkpad-pro-dock-sleep-external-display.service

[Unit]
Description=User resume actions
Before=suspend.target
[Service]
User=root
Type=simple
ExecStart=/usr/local/bin/thinkpad-pro-before-sleep.sh
[Install]
WantedBy=suspend.target

activate with systemctl enable thinkpad-pro-dock-sleep-external-display.service

create and chmod with 0770

/usr/local/bin/thinkpad-pro-before-sleep.sh

#!/bin/bash
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
if [ "$DOCKED" != "1" ]; then exit 0; fi
USER=`who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}'`
export XAUTHORITY=/home/$USER/.Xauthority
export DISPLAY=:0.0
xset dpms force off

External displays will now wake up with login screen after resume by i.e some mouse action


Kommentare

Kommentare deaktiviert.