This repo contains two bash scripts needed to be able to work with two external monitors using a docking station that works with DisplayLink software.
Important
These scripts are meant to be executed in an ArchLinux distro
The drivers_installation.sh script will install displaylink driver and evid for the kernel module.
Once these packages are installed it will create a 20-evdi.conf file inside /etc/X11/Xorg.conf.d directory. Then, the following content will be loaded inside this file:
Section "OutputClass"
Identifier "DisplayLink"
MatchDriver "evdi"
Driver "modesetting"
Option "AccelMethod" "none"
EndSection
Note
It may be necessary to restart the system after the installation.
Once the first script has finished installing everything run:
xrandr --listproviders
You should see a list of provider similar to this one (the number of providers may vary depending on how monitors do you have and if there is a dedicated GPU or not):
Providers: number : 4
Provider 0: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 4 associated providers: 2 name:modesetting
Provider 1: id: 0x2d9 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
Provider 2: id: 0x2a7 cap: 0x2, Sink Output crtcs: 1 outputs: 1 associated providers: 1 name:modesetting
Provider 3: id: 0x286 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-G0
Set the providers 1 and 2 (both external monitors) to the first provider of the list
xrandr --setprovideroutputsource 1 0
xrandr --setprovideroutputsource 2 0
Then run the setup.sh script to set the external monitors.
This script admits two arguments:
- The display name. By default, it gets DVI but a different name can be passed, such as HDMI.
- The name of the internal monitor. My laptop by default is named eDP1 but a different name can be passed.
The script will capture all the connected external monitors, set the first as the primary and the rest as extensions of the primary.
Note
If the monitors work with a resolution different of 1920x1080, the change must be done inside the script.
To run the setup.sh script automatically when logging:
- Open .xprofile file
- Add the following command
sh <path_to_script>
- Save the file
To run the setup.sh on boot:
- Locate your displaylink.service file looking at the Loaded info:
systemctl status displaylink.service
- Open the file in your code editor and verify it contains this information:
[Unit] Description=DisplayLink Manager Service After=display-manager.service Wants=display-manager.service
- Reload the system daemon and enable the service
sudo systemctl daemon-reload sudo systemctl enable displaylink.service
- Modify the display manager configuration. For sddm open the configuration file:
and write:
sudo nano /etc/sddm.conf
[XDisplay] DisplayCommand=/path/to/script.sh
Note
To know what display manager you have run systemctl status display-manager.service
- Restart the service
sudo systemctl restart sddm
Important
Make sure the file is executable by running sudo chmod +x /path/to/script
.
Tip
If there are any issues you can run journalctl -u sddm
to see the sddm logs.