Gnome/Ubuntu – Mirror One Monitor and Extend the Other

If you’ve encountered the challenge of wanting to extend your second monitor while mirroring your TV to your primary monitor, this tutorial will guide you through the process.

Step 1: Backup monitors.xml

Before making any changes, it’s always a good idea to create a backup of your current configuration. Open a terminal and enter the following command:

cp ~/.config/monitors.xml ~/.config/monitors.xml.backup

Step 2: Open the Configuration File

Now, open the monitors.xml configuration file with a text editor. In this example, we’ll use the Nano editor:

nano ~/.config/monitors.xml

Step 3: Locate the <logicalmonitor> Section

Within the configuration file, find the <logicalmonitor> section that corresponds to the monitors you want to mirror.

Step 4: Adjust the Configuration

Move the <monitor> part of one of the two monitors you want to mirror. Place it within the same <logicalmonitor> section as the other one. Then, delete the <logicalmonitor> section that only contains coordinates. Save your changes and reboot your computer.

Step 5: Troubleshooting

If, for any reason, your system encounters issues after making these changes and the graphical shell becomes unresponsive, you can still access the terminal. Here’s how:

  1. Accessing Terminal Without a Graphical Shell: If the graphical interface is not working, you can switch to a virtual terminal by pressing Ctrl + Alt + F3. This key combination will take you to a text-based terminal. To return to the graphical interface later, press Ctrl + Alt + F1.
  2. Restoring the Backup: Once in the terminal, navigate to the directory where you stored your backup: cd ~/.config/ Restore your previous configuration: cp monitors.xml.backup monitors.xml Reboot your computer: sudo reboot

Remember, creating a backup before making changes is always a good practice, providing a safety net in case anything goes wrong.

I hope this tutorial has been helpful.

This article has been crafted with the assistance of ChatGPT to enhance its clarity and readability.

Ein Kommentar

  1. Here is my final version of monitors.xml, as an example:

    <monitors version="2">
      <configuration>
        <logicalmonitor>
          <x>0</x>
          <y>0</y>
          <scale>1</scale>
          <primary>yes</primary>
          <monitor>
            <monitorspec>
              <connector>DP-1</connector>
              <vendor>DEL</vendor>
              <product>DELL P2419H</product>
              <serial>B238MV2</serial>
            </monitorspec>
            <mode>
              <width>1920</width>
              <height>1080</height>
              <rate>60.000</rate>
            </mode>
          </monitor>
          <monitor>
            <monitorspec>
              <connector>HDMI-1</connector>
              <vendor>HEC</vendor>
              <product>HDMI</product>
              <serial>0x00000001</serial>
            </monitorspec>
            <mode>
              <width>1920</width>
              <height>1080</height>
              <rate>60.000</rate>
            </mode>
          </monitor>
        </logicalmonitor>
        <logicalmonitor>
          <x>1920</x>
          <y>329</y>
          <scale>1</scale>
          <monitor>
            <monitorspec>
              <connector>DVI-D-1</connector>
              <vendor>ACR</vendor>
              <product>S242HL</product>
              <serial>LR9EE0038577</serial>
            </monitorspec>
            <mode>
              <width>1920</width>
              <height>1080</height>
              <rate>60.000</rate>
            </mode>
          </monitor>
        </logicalmonitor>
      </configuration>
    </monitors>

Schreibe einen Kommentar

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.