You are not logged in.

#1 2020-09-27 04:34:03

Apollo_V
Member
Registered: 2020-08-16
Posts: 8

Setting up multiple monitors with DWM

Hello all,

I'm trying to setup a monitor alongside my laptop which runs dwm. I think I made appropriate additions to the /etc/X11/xorg.conf file to account for the screens, monitors and devices. My machine is a Thinkpad p53 with optimus graphics (Nvidia Quadro + Intel igpu). The laptop screen is controlled by the Intel gpu and all other display outputs are controlled by the Nvidia card. What I can currently able to do are :

  • Output display to either the laptop display or the external monitor.

  • Connect both screens but the dwm is only on laptop screen while the external monitor is black screened but I can move my cursor over the screen.

  • X outputs to external monitor while the laptop monitor stays in tty after executing 'startx'.

 

My current /etc/X11/xorg.conf is

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0   "Screen0"
    Screen      1   "Screen1" LeftOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "Primary" "true"
    Option         "DPMS" "True"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS" "true"
    Option         "LeftOf" "Monitor0"
EndSection

Section "ServerFlags"
    Option "StandbyTime" "520"
    Option "SuspendTime" "530"
    Option "OffTime"     "560"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Intel Graphics"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Nvidia"
    Monitor        "Monitor1"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

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

Section "Device"
 Identifier     "Nvidia"
 Driver         "nvidia"
 BusID          "PCI:1:0:0"
 Option         "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
 Option         "AllowIndirectGLXProtocol" "off"
 Option         "TripleBuffer" "on"
EndSection

My current ~/.xinitrc is

 #!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then

    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then

    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

#Compositor
picom -f &

#Nitrogen Wallpaper
nitrogen --restore &

#Status bar
slstatus &

#xrandr --output HDMI-1-0 --auto

#Execute DWM
exec dwm
 

Please let me know if any other outputs are needed. Thanks in advance.

Offline

#2 2020-09-27 04:48:51

Apollo_V
Member
Registered: 2020-08-16
Posts: 8

Re: Setting up multiple monitors with DWM

Guys, I think I solved it by adding

Option "Xinerama" "1"

in the ServerLayout section of the /etc/X11/xorg.conf . Please let me know if any other better way is there. Currently it is working well.

Offline

#3 2020-09-27 12:41:08

coxe87b
Member
From: Canberra
Registered: 2019-12-08
Posts: 67

Re: Setting up multiple monitors with DWM

I have mine configured in the file

/etc/X11/xorg.conf.d/10-monitor.conf

as follows;

Section "Monitor"
  Identifier  "DP-3"
  Option      "Primary" "true"
EndSection

Section "Monitor"
  Identifier  "HDMI-1"
  Option      "LeftOf" "DP-3"
EndSection

I'm using i3 currently, but it has seemed to work well universally with other DEs and WMs since I set up this file. For clarification, my primary monitor is on DisplayPort port 3 and is on the right hand side of my desk, while my secondary monitor is connected to the HDMI port on my GPU and is on the left of the desk.

You can find out more information about the port names using

xrandr --listmonitors

Desktop: Arch Linux  |  i3-gaps WM  |  Intel Core i5-9600K  |  16GB RAM  |  AMD Radeon RX 6700XT  |  Dual monitors @ 1440p + 1080p
Laptop: Garuda Linux  |  Sway WM  |  Dell Latitude E7270  |  Intel Core i5-6300U  |  16GB RAM
~ Do or do not, there is no try ~

Offline

#4 2020-09-28 05:49:13

Apollo_V
Member
Registered: 2020-08-16
Posts: 8

Re: Setting up multiple monitors with DWM

I tried it but didn't work mostly cause my laptop display is controlled by intel graphics and monitor display by nvidia graphics. By adding

Option "Xinerama" "1"

, the behavior of the monitors is as expected. but the major problem I'm currently encountering is crashing of X server in different scenarios such as

  • Opening few websites (speedtest.net etc).

  • Getting errors saying cursor jumped on touchpad or external mouse.

  • when using the system after long hours( 2-3 hrs) of inactivity.

  Even opening VLC to play videos crashed the x server, I fixed this by using VLC internal video settings to use X11 video output rather than Open GL output. All the crashes report a Segmentation error in /var/log/Xorg.0.log. I do not know how to interpret these errors. Please let me know if any other information is needed.

Offline

#5 2020-09-30 13:30:00

coxe87b
Member
From: Canberra
Registered: 2019-12-08
Posts: 67

Re: Setting up multiple monitors with DWM

It sounds like a video card driver conflict, but I'm not knowledgeable enough to be able to offer anything more than that sorry. I always had issues with NVIDIA drivers in Linux years ago when I was using their GPUs. But I switched to AMD a few years back and haven't had any issues since. I know it's not that easy with a laptop though... You could try using the open source drivers and see if the same behaviour remains?


Desktop: Arch Linux  |  i3-gaps WM  |  Intel Core i5-9600K  |  16GB RAM  |  AMD Radeon RX 6700XT  |  Dual monitors @ 1440p + 1080p
Laptop: Garuda Linux  |  Sway WM  |  Dell Latitude E7270  |  Intel Core i5-6300U  |  16GB RAM
~ Do or do not, there is no try ~

Offline

#6 2020-09-30 18:05:24

seth
Member
Registered: 2012-09-03
Posts: 49,971

Re: Setting up multiple monitors with DWM

All the crashes report a Segmentation error in /var/log/Xorg.0.log

Please post the log, there's usually a short backtrace at the end.
Most likely you're mixing intel/nvidia driver & GL/GLX library.

The debouncer is usually just a symptom of a different problem (hang) or irrelevant and just indicates unreasonable input events.

Offline

Board footer

Powered by FluxBB