I’ve recently bought an ASUS Zephyrus M to replace my ZenBook Pro as laptop & my Z820 in the second room, so the idea is to use a docking to instantly connect my screens/keyboard/mouse/lan, i choosed the Kensington SD4500.
The SD4500 is working great out of the box on Windows, but on linux it’s an other story.
The problem is, the built-in screen is linked to the iGPU (through a multiplexer) but the USB-C screens are directly linked to the discrete GPU. Which means, when the laptop is connected to the dock, the nvidia gpu will be always on.
The setup is made on Archlinux, xf86-video-intel & nvidia driver with bumblebee, gnome3 on xorg.
First off all, we need to setup xorg to use intel virtual screens
Replace the content of the bumblebee xorg.conf file with this config
At this state, you can try if everything is working as it should be by manually starting intel-virtual-output as a normal user (considering your user is in the bumblebee group).
This command will start a second xorg screen :8 on the discrete gpu with bumblebee and redirect the content to the virtual screens. (Correct me if i’m wrong).
If the previous command works great, we need to configure systemd to automatically start the intel-virtual-output service when we connect the dock.
This involve udev & systemd.
On my setup i’ve created a udev rule to rename the interface from eth0 to dock0 (better management with NetworkManager in the future and avoid false-positive if we use usb-ethernet adapter in portable mode)
Check if the udev rule is working by plugging your dock, the interface should appear as dock0