Mirror screen with Gnome?

I managed to get a persistent 3 screen setup with screen 3 mirroring screen 1 and screen 2 being an extension. As far as I know there’s no graphical solution to this, but there’s a config file ~/.config/monitors.xml which controls how the physical monitors should be mapped to logical monitors. So I just had to delete one section from that file and move that tag to the tag which I wanted to be mirrored.
Copying that file into the system config directory even makes this persistent for the login screen (sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/monitors.xml).

In case this is helpful to others, I’m posting my config as an example:

<monitors version="2">
  <configuration>
    <logicalmonitor>
      <x>3840</x>
      <y>0</y>
      <scale>1</scale>
      <monitor>
        <monitorspec>
          <connector>DP-2</connector>
          <vendor>GSM</vendor>
          <product>YOURSCREENSNAME</product>
          <serial>YOURSCREENSSERIAL</serial>
        </monitorspec>
        <mode>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996623992919922</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>DP-1</connector>
          <vendor>GSM</vendor>
          <product>YOURSCREENSNAME</product>
          <serial>YOURSCREENSSERIAL</serial>
        </monitorspec>
        <mode>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996623992919922</rate>
        </mode>
      </monitor>
      <monitor>
        <monitorspec>
          <connector>DP-3</connector>
          <vendor>GSM</vendor>
          <product>YOURSCREENSNAME</product>
          <serial>YOURSCREENSSERIAL</serial>
        </monitorspec>
        <mode>
          <width>3840</width>
          <height>2160</height>
          <rate>59.996623992919922</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
</monitors>

That configuration will produce this result (note the monitor numbering showing 2 | 4 indicating a mirrored mode):

(I have a fourth monitor connected which is disabled most of the time, hence it reads 2 | 4 instead of 2 | 1)

1 Like