4

I have two monitors with resolutions 1366x768(CRT1) and 1024x768(CRT0). CRT0 stays to the right from CRT1 so common resolution is (1366+1024)x768. Recently I noticed that when I move mouse from CRT1 to CRT0 it doesn't go to CRT0 immideately, that is, the common resulution is bigger than (1366+1024)x768. I went to X Server Settings and there was the following:
enter image description here
It is really wierd where that 1708 number came from but I didn't think much about it and just changed it to +1366+0, saved it to /etc/X11/xorg.conf and forgot about it. But on the next boot I see misterious +1708+0 again. I tried to change settings to this:
enter image description here
That worked only until reboot too. So I am lost. I don't have any errors, I am able to save xorg.conf I tried everything I could have thought of, but on each boot I get that +1708+0.
Here's my /etc/X11/xorg.conf.

Ubuntu 14.04 LTS x64

$ cat /proc/version
Linux version 3.19.0-42-generic (buildd@lgw01-24) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #48~14.04.1-Ubuntu SMP Fri Dec 18 10:24:49 UTC 2015

$ dpkg -l | grep nvidia
ii  nvidia-331                                            340.96-0ubuntu0.14.04.1                             amd64        Transitional package for nvidia-331
ii  nvidia-340                                            340.96-0ubuntu0.14.04.1                             amd64        NVIDIA binary driver - version 340.96
rc  nvidia-libopencl1-340                                 340.96-0ubuntu0.14.04.1                             amd64        NVIDIA OpenCL Driver and ICD Loader library
ii  nvidia-opencl-icd-340                                 340.96-0ubuntu0.14.04.1                             amd64        NVIDIA OpenCL ICD
ii  nvidia-prime                                          0.6.2                                               amd64        Tools to enable NVIDIA's Prime
ii  nvidia-settings                                       331.20-0ubuntu8                                     amd64        Tool for configuring the NVIDIA graphics driver

Thank you in advance.

UPD

The issue with screen position has been fixed, it was about monitors.xml file which overrided xorg.conf settings, thanks to @Jacob Vlijm. But when I changed position in monitors.xml ubuntu forgot where is my primary monitor and now after reboot I have monitors 'swapped' where I have to move mouse to the left in order to go to right monitor. Here's my monitors.xml. By the way, This solution didn't help.

Timofey
  • 142

2 Answers2

4

There are many possible reasons why a screen configuration does not "survive" a restart. In most cases, there are local sources like the monitors.xml file that simply overrule previously made settings.

Finding out what it is exactly, can be time-consuming, so my approach would be the practical solution: simply overrule whatever happens on log in by a simple command or small (xrandr) script. In this case, it is probably done by the command:

xrandr --output VGA-0 --pos 0x0 && xrandr --output DVI-I-0 --pos 1366x0

which arranges the screens from left to right, which you should always do.

Add the command to startup (log in)

Choose Dash > Startup Applications > Add, add the command:

/bin/bash -c "sleep 15 && xrandr --output VGA-0 --pos 0x0 && xrandr --output DVI-I-0 --pos 1366x0"

Explanation:

  • postioning a screen can be done with the command:

    xrandr --output VGA-0 --pos 0x0
    

    to position e.g the left screen, then:

  • Always arrange the screens from left to right

  • The sleep 15 is to make sure the command runs when the desktop is "ready", and possible local settings do not overrule the command.
Jacob Vlijm
  • 85,475
0

To expound further on one aspect of @Jacob's answer: The monitor.xml file does override any similar left-to-right ordering that is set up in the nVidia Settings. Under Unity, System Settings/Display updates the ~/.config/monitor.xml file. Change the order of what monitor is on the left or right by dragging and dropping the rectangular boxes at the top of the window:

enter image description here

Start nVidia Settings via the main Search Your Computer button:

enter image description here

And it is here that you think you can change the order, but the monitor.xml file will override it:

enter image description here

I was tempted to just delete the monitors.xml file, in hope that the nVidia Settings would take command of the situation, but a comment on another answer implies this is not a good thing to do.

bgoodr
  • 1,612