1

I recently switched from Gentoo to Void Linux and installed it on a system with one monitor.

But now I have switched locations and use a two monitor system. On my Gentoo installation, everything worked and X11 recognized that the two screens should not be merged together, but rather, should be distinct screens.

Here is the output of XRandR:

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  50.00    59.94
   1600x1200     60.00
   1680x1050     60.00
   1600x900      60.00
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x800      60.00
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
   720x400       70.08
HDMI-A-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 698mm x 393mm
   1920x1080     60.00*+ 239.96   144.00   120.00   119.88   119.98    50.00    59.94
   1680x1050     60.00
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x800      60.00
   1280x720      60.00    50.00    59.94
   1024x768     119.99    75.03    70.07    60.00
   832x624       74.55
   800x600      119.97    72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

The issue, at least it seems to me, is that it extends HDMI-A-0 (1920x1080+1920+0). This fear is confirmed if I use ghc to get all of the Screens, which X11 provides to applications.

The output of the command

ghc -e "Graphics.X11.openDisplay [] >>= Graphics.X11.Xinerama.getScreenInfo"

is the following:

[Rectangle {rect_x = 0, rect_y = 0, rect_width = 3840, rect_height = 1080}]

Just to clarify, what I want is that X11 provides two screens (each 1920x1080) instead of one long screen (3840x1080)

I have tried to find answers online, including the following commands. None of them worked

xrandr --output HDMI-A-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --scale 1x1 --size 1920x1080+0+0 \
      --output DisplayPort-0 --mode 1920x1080 --left-of HDMI-A-0 --rotate normal --scale 1x1 --size 1920x1080+0+0 ;
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0 --pos 1920x0
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0 --pos 0x0
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0

And so on..

Thanks for any help

1
  • I got very similar symptoms in Xmonad on NixOS after I got it compile with stack. I cannot reproduce your ghc call but Xmonad also thinks I have one large screen instead of two. My guess is that I changed or missed some dependent system libraries that are used by Xmonad. Did you find a solution?
    – schoettl
    Jan 31 at 9:11

1 Answer 1

0

A reason might be that "your Haskell X11 library was not built against Xinerama".

The following check should be done before checking openDisplay "" >>= getScreenInfo:

ghc -e Graphics.X11.Xinerama.compiledWithXinerama

https://wiki.haskell.org/Xmonad/Frequently_asked_questions#Multi_head_or_xinerama_troubles


I had this problem with Xmonad on NixOS using stack, and I fixed it with this stack.yaml file:

resolver: lts-19.33
packages:
  - .
nix:
  enable: true
  packages:
    - xorg.libX11
    - xorg.libXinerama # <-- important for multi-display support
    - xorg.libXext
    - xorg.libXft
    - xorg.libXrandr
    - xorg.libXScrnSaver
    - pkg-config

Note that you must force a rebuild of the X11 library (e.g. by rm -rf ~/.stack, a very rough method!)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .