Just a few days ago I finally fixed an annoyance with my Thinkpad T460p and the Ultra Dock: Removing the laptop from the Dock results in it going into hibernation. Then after opening the lid it does not switch the built in screen back on. This turns out to be easy to fix.

Undocking and docking leads to a lot of events which can be observed by a simple

sudo acpi_listen


The event that seems to be the most promising is used as a trigger to correct the display settings. In my case that meant putting

event=ibm/hotkey LEN0068:00 00000080 00004011
action=su carl -c "xrandr -d :0.0 --output eDP1 --auto"


into /etc/acpi/events/thinkpad-undock. After that the the last thing to do is restarting the acpi daemon:

sudo systemctl restart acpid.service