Open ghost opened 7 years ago
Ugliest hack ever, but this seems to work with Wayland:
Add this to /etc/rc.local
:
chmod 666 /sys/class/drm/card0-HDMI-A-2/status
Create /usr/local/bin/screen-hotplug
:
#!/bin/sh
echo 'detect' > /sys/class/drm/card0-HDMI-A-2/status
Make it executable:
sudo chmod +x /usr/local/bin/screen-hotplug
Bind that script to a key, such as the blue ThinkVantage button. Press it every time you dock and every time you undock.
Works for me with DP<>HDMI adapter, without any workarounds in X11 (enlightenment), wayland (weston) and even just plain VT HW: X200T
When docking an X200 with an external DisplayPort monitor, the latter isn't automatically attached.
udevadm monitor
doesn't show a singledrm
-related event.Wten undocking an X200 with an external DisplayPort monitor, the latter isn't automatically detached either.
udevadm monitor
doesn't show a singledrm
-related event.After (un)docking, one has to run
xrandr
to force detection of the DisplayPort output. Luckily, this can be bound to a hotkey as it works as a regular user.However, with Wayland,
xrandr
no longer works at all..I have found that running
echo detect > /sys/class/drm/card0-HDMI-A-2/status
as root forces re-detection of the DP link state, but this can't be run easily, and certainly not as a hotkey command.Ideally, the (un)docking ACPI code should trigger
drm
udev events so the kernel automatically enables and disables DisplayPort output. This is much needed with Wayland at least.