Can't rotate monitor on 20.04

I did a fresh install yesterday and got the same issue. I was able to reconfigure the mess via the Nvidia configurator but it only last for the current session (i.e. I have to redo it all over again each time I reboot).

Here a workaround :

First create a bash script, assuming your 3 monitors are in 1920x1080 mode (if not, you will have to adjust the "--pos" offset accordingly) and the primary is the middle one :

#!/bin/bash
xrandr --output [Your monitor "2" ID] --pos 0x0 --rotate left --mode 1920x1080 
xrandr --output [Your monitor "1" ID] --primary --pos 1080x360 --mode 1920x1080 
xrandr --output [Your monitor "3" ID] --pos 3000x360 --mode 1920x1080 

(the 360 y-offset put your monitor 1 and 3 roughly at the middle of the left one, adjust it as you please)

Then make it executable and add it in your startup app list. At this point, when you boot, the script may kick in before the GUI is ready (so it does nothing). Open ~/.config/autostart/[your_script_entry_name].desktop in an editor and add the line

X-GNOME-Autostart-Delay=1

(For some reason, putting a "sleep" command in the bash script does not work, but the startup delay does...) That did the trick for me, I hope it helps


After pondering a little longer, I tried rotating the screen via the shell with xrandr (xrandr --output DVD-I-1 --rotate right), and I'm up and running.

Weird bug, but hopefully the changes stick


I have a solution inspired by this comment#25 in the mutter bug.

First, we create a ~/.config/monitors.xml file for the layout (we can experiment a layout with xrandr). My monitors.xml is attached below.

Then, copy the monitors.xml to /var/lib/gdm3/.config/ and change file owner:

sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
sudo chown gdm:gdm /var/lib/gdm3/.config/monitors.xml

The monitor layout will persist across restarts and screen locks.

<monitors version="2">
  <configuration>
    <logicalmonitor>
      <x>1440</x>
      <y>0</y>
      <scale>1</scale>
      <primary>yes</primary>
      <monitor>
        <monitorspec>
          <connector>HDMI-0</connector>
        </monitorspec>
        <mode>
          <width>3840</width>
          <height>1600</height>
          <rate>59.993923187255859</rate>
        </mode>
      </monitor>
    </logicalmonitor>
    <logicalmonitor>
      <x>0</x>
      <y>0</y>
      <scale>1</scale>
      <transform>
        <rotation>left</rotation>
        <flipped>no</flipped>
      </transform>
      <monitor>
        <monitorspec>
          <connector>HDMI-1</connector>
        </monitorspec>
        <mode>
          <width>2560</width>
          <height>1440</height>
          <rate>59.950550079345703</rate>
        </mode>
      </monitor>
    </logicalmonitor>
  </configuration>
</monitors>

Tags:

Display

20.04