I'm at the office and doing this again, so here is the (painful) process that functions as a workaround. First generate diffs to locate the configuration to edit (my monitors.xml
had 8 configurations, so it was not easy to spot what to edit). To make this easier, ideally put the primary monitor in the correct location. Otherwise, it is easy to accidentally delete the <primary>yes</primary>
, which will break the workaround.
cd ~/.config
cp monitors.xml monitors.xml.before
gnome-control-center # move a display and apply the changes
diff monitors.xml monitors.xml.before # to confirm/locate the change
Once you have successfully caused a change to the <configuration>
, you can look at the diffs to determine which <configuration>
block you need to edit. Beware that most diff
tools are not xml savvy, so you may see the diff start and stop in the middle of xml blocks (<x>...</logicalconfiguration></configuration><configuration><logicalconfiguration>
instead of <configuration><logicalconfiguration><x>...</logicalconfiguration></configuration>
)
Edit as follows:
- Open ~/.config/monitors.xml
- Find the section that was edited
- Pay attention to the offsets of the
<logicalmonitor>
sections and use this information to locate the incorrectly placed monitor. In my case, I have two of the displays where I want them (at <x>0</x>
/ <y>0</y>
and at <x>1980</x>
/ <y>0</y>
) and I have a third that is in the wrong location (at <x>3840</x>
/ <y>830</y>
)
- Cut the entire
<logicalmonitor>...</logicalmonitor>
section that is in the wrong location and paste it into a second document (to remove it from monitors.xml
and to keep it accessible for the next step)
- Copy only the
<monitor>...</monitor>
section from the second document
- Paste the content copied from #5 just before or after the existing
<monitor>...</monitor>
line in the section that you want to be mirrored.
- Confirm that one (and only one) of the
<logicalmonitor>
sections contains <primary>yes</primary>
.
- Make a backup of
monitors.xml
, since an error will cause Gnome to wipe the file, losing all of your other configurations (if it's a laptop and you use multiple external displays).
- Reboot, log in to Gnome, and hopefully you will see your new configuration.
Note: you can paste into a section with <primary>yes</primary>
and mirror the primary display. If you cut from the section containing this, you need to copy/paste it as well. This line is after <scale>1</scale>
(or whatever your scale is) and before the first <monitor>
in the <logicalmonitor>
section.