Skip to content

Instantly share code, notes, and snippets.

@AirManH
Last active October 1, 2020 05:50
Show Gist options
  • Save AirManH/511b472e51e728ca055e490f56cc6c19 to your computer and use it in GitHub Desktop.
Save AirManH/511b472e51e728ca055e490f56cc6c19 to your computer and use it in GitHub Desktop.
xorg config files

xorg config files

Dual Monitor

See this nvidia page for details.

Introduction

-----------------------       -----------------------------
| screen 1 (external) |       | screen 0 (laptop default) |
|   device: "nvidia"  | <---- |   device: "intel"         |
|     driver: nvidia  |       |     driver: intel         |
-----------------------       -----------------------------
          | |                 /++++++++++++++++++++++++++++\
         =====                ------------------------------
  1. Run startx, only the external monitor will be activated by default.
  2. Then execute xrandr script below, the laptop default monitor will be activated.

Two monitor will share one screen, where you can drag windows between.

Code

/etc/X11/xorg.conf:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
    Option "TripleBuffer" "True"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    BusID "PCI:0:2:0"
    Option "TearFree" "true"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

xrandr script (example):

xrandr --setprovideroutputsource Intel NVIDIA-0
xrandr --output eDP1 --auto --output DP-0 --left-of eDP1

Further more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment