Xorg.conf randr doesn't do anything (but xrandr does)

Hi there! I have Manjaro 21 w/Gnome 40, in a desktop PC with Ryzen 5900 and NVidia 1660 ti. I use 3 monitors, one of which I watch using a mirror (technically a beamglass, part of a teleprompter). In order to look at the correct image, I need to horizontally flip the image for this display.
Through the command line, I successfully achieve the effect by typing:
xrandr --output DP-2 --reflect x
I tried to make the changes permanent following this procedure. I created the file /etc/X11/xorg.conf.d/10-monitor.conf with the following contents:

Section "Monitor"
    Identifier  "DP-2"
    Option      "reflect" "x"
EndSection

but to no avail. Nothing happens after boot. Do you know if I mistyped anything? Is there a log file I could check to find out what the problem might be?

Thanks a lot,
Alan

If you have looked at:

man xorg.conf

you would see that there is not such an option like “reflection” at the monitor section. Instead you have to do something like this, if I understood correctly:

Section "Monitor"
    Identifier   "DP-0"
    Option      "PreferredMode" "1920x1080"
    Option       "Position" "0 0"
EndSection
Section "Monitor"
    Identifier   "DP-1"
    Option      "PreferredMode" "1920x1080"
    Option       "Position" "1920 0"
EndSection
Section "Monitor"
    Identifier   "DP-2"
    Option      "PreferredMode" "1920x1080"
    Option       "Position" "1920 0"
    Option       "Rotate" "inverted"
EndSection

Check /etc/X11/mhwd.d/nvidia.conf

Hi and thanks!

I had found the “reflect” option from this page, which seems to describe a specific version of xorg.conf, so no luck there. Sadly “rotate” does not flip the display, but rather rotates it, which is not satisfactory in my particular case.

I have also tried creating an ~/.xprofile and /etc/xprofile which the command line statement that does work ( xrandr --output DP-2 --reflect x), but also no luck. According to this wiki entry, GDM should source .xprofile and /etc/xprofile, but nothing happens and I am not sure where to look for any kind of associated logging.

Thanks!
Alan

Hi!

I checked nvidia-xconfig, but it just generates a regular xorg.conf file. The lack of a reflect option seems to be a stopper here too.

Thanks,
Alan

Nvidia does not have reflect instead is using
Option "RandRRotation" "on"
but the file is the one i mentioned.

then you can use
xrandr --output DP-2 -x

1 Like

Thanks, but luckily performing mirroring through xandr in the command line already works. My problem is I can’t find a way of performing the mirroring automatically after booting. Right now I run it manually every time I boot or turn off/on a display.

Regards

You can add the command in your ~/.xinitrc file. it have to be above the exec $(get_session "$1") command. Like this:

# & at the end is important, because it must run at same time as the session starts.
xrandr --output DP-2 --reflect x &

exec $(get_session "$1")

It will apply, when the gnome-session starts, so when you login (not on GDM).

1 Like

Hi! I just tried this solution, but still no reflection on logging in.

mh… maybe add a delay?

(sleep 10; xrandr --output DP-2 --reflect x) &

Since gnome has zsh by default, try to add it to this file: ~/.zshrc.

Or another thing: ~/.config/autostart ← there you can add *.desktop files which should start at the beginning. Create a script, make it executable, add it to /bin or ~/bin/ (in this case also add export PATH=$HOME/bin:$PATH to this file ~/.zshrc). Then create a desktop file, which will execute the script at the autostart directory.

gnome-tweaks has also an option to manage autostarts.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.