Skip to content

Instantly share code, notes, and snippets.

@cyruzin
Last active July 2, 2020 17:27
Show Gist options
  • Save cyruzin/924da6fc977fd8ad5fe2e0868ee8a310 to your computer and use it in GitHub Desktop.
Save cyruzin/924da6fc977fd8ad5fe2e0868ee8a310 to your computer and use it in GitHub Desktop.
Multi monitor setup under XORG on Linux

Multi monitor setup under XORG on Linux

These configurations have been tested on Manjaro with XFCE.

Working perfectly on 2 monitors:

1920x1080p

3840x2160p

First, you will need to download the xorg-xrandr package:

Arch / Manjaro

sudo pacman -S xrandr-xorg

Debian / Ubuntu

sudo apt update && sudo apt install x11-xserver-utils

Script

This script will probably change over the time, so you need to know the name of the monitors and it's respective locations, read the xrandr documentation.

Create a file called display.sh and paste the script below:

#!/bin/sh

xrandr --output HDMI-A-0 --auto --pos 0x1080 --output DisplayPort-2 --scale 0.70x0.70 --pos 1920x0 --right-of HDMI-A-0

Then make the it executable:

chmod 755 display.sh

After that, move the script to: /usr/local/bin

sudo mv display.sh /usr/local/bin

Make it permanent

Edit the file /etc/lightdm/lightdm.conf and uncomment the line: display-setup-script= and add the path to your script:

display-setup-script=/usr/local/bin/display.sh

Useful links

Todo

  • Test in another desktop environment (Gnome, KDE).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment