1

I run Ubuntu 14.04 Gnome Desktop with two displays. After startup, the two displays work, but they are not at the right position. I need the left one on the right and vice-versa.

I use the display manager to change and apply changes, but it won't persist after reboot.

I already tried modifying .config/monitors.xml, swapping the <y> values of both monitors, but it didn't work.

Any idea how to persist the configuration without using a custom xrand command ?

Here is the configuration I want:

Screen 0: minimum 320 x 200, current 3840 x 1200, maximum 16384 x 16384
DisplayPort-0 connected 1920x1200+0+0 (normal left inverted right x axis y axis) 518mm x 324mm
     1920x1200      60.0*+
     ...
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected primary 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm
     1920x1200      60.0*+
     ...

But upon startup the left inverted right are swapped.

Jacob Vlijm
  • 83,767
Derlin
  • 293

1 Answers1

1

Remember monitor setup: add it to Startup Applications

There are many possible reasons why a monitor setup would not "survive" a reboot. In far most situations, the pragmatic solution is to simply make the setup run automatically on startup (log in actually).

How to do that

In your situation, DisplayPort-0 obviously represents the left monitor, as we can see in:

DisplayPort-0 connected 1920x1200+0+0

where the last section, +0+0 is the x/y offset of the screen, as explained here.

The command to position a monitor looks like:

xrandr --output DVI-0 --pos 1920x0

In commands, we should always position monitors from left to right, so the command in your situation is:

xrandr --output DisplayPort-0 --pos 0x0 && xrandr --output DVI-0 --pos 1920x0

However, we need a break

If we add the command to Startup Applications just like that, it will almost certainly run too early, and either break, or be overruled by incorrect local settings, called afterwards.

The complete command, to add to Startup Applications therefore should include a break of appr. 15 seconds:

/bin/bash -c "sleep 15 && xrandr --output DisplayPort-0 --pos 0x0 && xrandr --output DVI-0 --pos 1920x0"

How to add to Startup Applications

Open Dash > Startup Applications > Add. Add the command:

/bin/bash -c "sleep 15 && xrandr --output DisplayPort-0 --pos 0x0 && xrandr --output DVI-0 --pos 1920x0"

Note

Please try the command below (without the break) first from a terminal, to see if it runs correctly:

xrandr --output DisplayPort-0 --pos 0x0 && xrandr --output DVI-0 --pos 1920x0

Although I checked well, blind spots and typos are always possible :)

Jacob Vlijm
  • 83,767