5

I have a triple monitor setup (xorg.conf generated with amdcccle: http://pastebin.com/gWSVEyLa) running on Arch Linux with Xmonad as my window manager. Physically, there is an HDTV off to the left, a nice dell monitor in the center and a rotated monitor off to the right. Because my HDTV only has one HDMI input I am using a 4 input, 2 output switch with some other devices. My HDTV isn't always connected, which causes that section of my virtual desktop to be disabled. This causes lots of annoyances:

  1. An annoying screen flicker due to the driver's hotplug event (which basically runs xrandr --auto).
  2. The physical screen order gets changed (the hdtv becomes the third monitor instead of the first), causing my keybindings for focusing on a screen to be wrong. I have made this a non-issue with my xmonad config, but the bindings still change when there are only two monitors detected.
  3. If I start my computer without the HDTV connected, that section of my virtual desktop isn't usable until it becomes connected on the hotplug event or I run xrandr to enable it.
  4. Windows from the workspace on the disconnected monitor are moved to other workspaces on visible monitors. This basically means any windows that were showing on my HDTV get thrown around randomly, which is pointless because of the way Xmonad handles workspaces.
  5. I can't put one or two monitors into dpms standby or turn a display off manually with xrandr --off because the others will freak out. For example, if I was just using my tv to watch something, I don't necessarily want the other two monitors to be turned on, but I want their window positions kept intact.

When I switch inputs on the HDMI switch or turn it on/off, or physically disconnect cables this is interpreted by my video driver as disconnecting my monitor and it is removed from my virtual desktop. I want X to always act as if all three of these monitors are connected and not to respond to any monitor hotplugging events. It's great that Linux is capable of working with completely automatic xorg configuration, but I want this exact setup all the time until I change my hardware. The hotplug events looks like this in my xorg logs:

When disconnected:
  [  1684.459] (II) fglrx(0): Hot-plug event occurs on device: 1:0:0
  [  1684.459] (II) fglrx(0): EDID vendor "DEL", prod id 40993
  +--  3 lines: [  1684.459] (II) fglrx(0): Using hsync ranges from config file-----------------------------------------------------------------------------------------------------
  +-- 11 lines: [  1684.459] (II) fglrx(0): Modeline "1600x1200"x0.0  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync (75.0 kHz eP)----------------------------------
  [  1684.468] (II) fglrx(0): xdl_xs113_atiddxDisplayScreenEnableDisplays
  [  1684.468] (II) fglrx(0): User Preference Output DFP1 using refresh rate 60.0 Hz.
  [  1684.537] (II) fglrx(0): User Preference Output DFP10 using refresh rate 60.0 Hz.

When reconnected:
  [  1694.077] (II) fglrx(0): Hot-plug event occurs on device: 1:0:0
  [  1694.210] (II) fglrx(0): EDID vendor "DEL", prod id 40993
  +--  3 lines: [  1694.210] (II) fglrx(0): Using hsync ranges from config file-----------------------------------------------------------------------------------------------------
  +--  9 lines: [  1694.210] (II) fglrx(0): Modeline "1600x1200"x0.0  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync (75.0 kHz eP)----------------------------------
  [  1694.219] (II) fglrx(0): xdl_xs113_atiddxDisplayScreenEnableDisplays
  [  1694.219] (II) fglrx(0): User Preference Output DFP1 using refresh rate 60.0 Hz.
  [  1694.288] (II) fglrx(0): User Preference Output DFP9 using refresh rate 60.0 Hz.
  [  1694.359] (II) fglrx(0): User Preference Output DFP10 using refresh rate 60.0 Hz.

I really don't care about hotplugging because I'm using Xmonad and would rather always output to these three devices, regardless whether or not they are considered connected. There might be some way of configuring the video driver to do what I want, but I'm not sure the option exists and haven't found any good information yet, so I'm asking here. If this was working correctly, the output of these two commands would be identical and would cause nothing to happen visually besides the HDTV turning off/on:

$ xrandr | grep 'DFP.* connected'
DFP1 connected 2560x1600+1920+0 (normal left inverted right x axis y axis) 641mm x 401mm
DFP9 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
DFP10 connected 1200x1600+4480+0 left (normal left inverted right x axis y axis) 367mm x 275mm
$ xrandr --verbose --output 'DFP9' --off
screen 0: 3760x1600 994x423 mm  96.08dpi
crtc 0:    2560x1600   60.0 +0+0 "DFP1"
crtc 2:    1600x1200   60.0 +2560+0 "DFP10"
$ xrandr | grep 'DFP.* connected'
DFP1 connected 2560x1600+0+0 (normal left inverted right x axis y axis) 641mm x 401mm
DFP9 connected (normal left inverted right x axis y axis)
DFP10 connected 1200x1600+2560+0 left (normal left inverted right x axis y axis) 367mm x 275mm
$ xrandr --verbose --output 'DFP9' --preferred --pos 0x0 --output 'DFP1' --preferred --pos 1920x0 --output DFP10 --preferred --pos 4480x0
screen 0: 5680x1600 1501x423 mm  96.08dpi
crtc 0:    2560x1600   60.0 +1920+0 "DFP1"
crtc 1:    1920x1080   60.0 +0+0 "DFP9"
crtc 2:    1600x1200   60.0 +4480+0 "DFP10"
$ xrandr | grep 'DFP.* connected'
DFP1 connected 2560x1600+1920+0 (normal left inverted right x axis y axis) 641mm x 401mm
DFP9 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 708mm x 398mm
DFP10 connected 1200x1600+4480+0 left (normal left inverted right x axis y axis) 367mm x 275mm
1

I've been trying to fix this problem for weeks now. The best I got was setting an up an xrandr script that sets the displays and their position to what I what and I bound that script to a keyboard shortcut. That way whenever I turn one monitor off, or wake up from sleep, i press the shortcut and all the displays get set to what I want.

My script:

First I got the names of my displays by running the command xrandr. For me, they were DP3.1, DP3.2, and DP-4.

Then I set up my command with both their resolution and relative position:

xrandr --output DP-3.1 --auto --output DP-3.2 --auto --right-of DP-3.1 --output DP-4 --auto --right-of DP-3.2

It would be much nicer if xrandr simply "remembered" these settings and never changed. When my monitors wake up from sleep, it detects them as unplugged and messes things up, requiring this script, which takes a couple of seconds to run.

  • Ultimately, the solution I ended up implementing is a mess of udev events and xrandr scripts. I have a displayport switch, so when I change the input my center monitor disappears, which still has issues (sometimes duplicates the display of my other two monitors). – s00pcan Jan 5 '17 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.