7

I have a fresh ubuntu 13.10 install and a dual-monitor setup. I can't get the setup working propely because the monitor settings get reverted every time I reboot.

How do I fix this?

Note that I get the initial settings when I start nvidia-settings after a logout/reboot.

6 Answers 6

7

Okay I got it working: You have to change the display settings in system settings -> display as well.

Now everything works like a charm!

2
  • 1
    what you did pls elaborate
    – Alex Jones
    Mar 22, 2015 at 11:19
  • Very simple and made the trick. Thanks brother! Oct 24, 2015 at 3:20
3

The only solution for me was dconf-editor, and search for xrandr using Ctrl-F.

Disable the following keys:

org.cinnamon.settings-daemon.plugins.xrandr.active = false
org.gnome.settings-daemon.plugins.xrandr.active = false

Remove the old monitors.xml:

rm ~/.config/monitors.xml

Then setup the montiors with sudo nividia-settings. After that apply settings and save Xorg.conf to /etc/X11/xorg.conf.

Reboot, and it should work.

2
  • unfortunately I cannot see xrandr anymore in ubuntu18.04, can it be harcoded now?
    – Wang
    Apr 14, 2019 at 13:43
  • there is no xrandr plugin any more setting that to false has no effect. And there is a new bug, monitors.xml is also ignored. You have to use command line tools to setup in .xinitrc
    – Wang
    Apr 14, 2019 at 18:34
2

Add nvidia-settings --load-config-only (see man page) to your startup programs, that should apply your settings each time you login.

What's happening here is that nvidia-settings correctly saves your settings to ~/.nvidia-settings.rc, but can't reapply them after a restart unless run. Since you probably don't want to see its window every time you login, the --load-config-only switch tells it to load the existing config, apply it and exit.

2
  • 2
    I tried that, unfortunately it doesn't help. With Ubuntu 13.10 nvidia-settings -l get's automatically written to the Session Manager. Also rerunning nvidia-settings shows me a fresh config, where all my settings have been resettet.
    – machete
    Nov 14, 2013 at 15:51
  • I think this is supposed to be the correct answer but as described it is getting overwritten on each boot on Ubuntu 22.04 as well Oct 19, 2022 at 3:15
1

I solved this problem with following steps.

mv ~/.config/monitors.xml ~/.config/monitors.xml.bak

That monitors.xml overrides xorg.conf every time reboot.

sudo nvidia-settings

then set you want, save the file to /usr/share/X11/xorg.conf.d/xorg.conf

That's it. This should solve your problem.

1
  • 2
    This is not going to work ... gnome will use default monitor setting and ignore your xorg.conf completely
    – Wang
    Apr 14, 2019 at 18:32
1

It could be that lightdm is overriding you setting. See this answer here.

0

I struggled with this problem too for years. I have PopOs 22.04, but have found a solution by creating a script.

nvidia-settings can be used on the command line to set all settings you see in the nvidia gui, but first, you need to know which attribute to set.

The Task

In my case, I wanted to:

a) configure the locations and orientations of 4 displays b) set one as the main display.

The steps to have these set at startup are:

  1. capture the current configuration from the xorg.conf file
  2. write a script that writes the orientation/location/main monitor settings via nvidia-settings command line option
  3. run the script at startup

Let's begin:

1) Capture the current configuration

Open the nvidia GUI through your OS, or via the command-line by typing: nvidia-settings.

Next, click "X Servier Display Configuration" set the orientation and location of each display, and the main display.

2) Grab the X Configuration settings

A popup appears, click "Show Preview" enter image description here

Copy the preview text into an editor.

3) Find the options you want to save

The two options I was interested in are below: enter image description here

a) nvidiaXineramaInfoOrder

b) metamodes

4) Find out what the attribute names are

We need to find the attribute names for the above settings so we can feed them to nvidia-settings via the command line

type

nvidia-settings --query all > attributes.txt

This will show all the possible attributes we can set,

After reading the attributes.txt, it looks like the attribute I need for order, and locations/orientations are

XineramaInfoOrder
CurrentMetaMode

5) Write the Script:

So I created a script using the above attributes and the values from the xorg preview:

mkdir ~/bin
cd ~/bin
sudo nano nvidiaStartup.sh

Now paste in the command:

nvidia-settings --assign <attributeName>="<your setting from xorg.conf"

example:

#!/bin/bash
nvidia-settings --assign CurrentMetaMode="DP-0: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +0+1050, DP-1: nvidia-auto-select +1920+1080, DP-3: nvidia-auto-select +4480+1080 {rotation=right}"
nvidia-settings --assign XineramaInfoOrder="DP-1"

6) Set startup applications

Next, set the permissions of the script

sudo chmod u+x ~/bin/nvidiaStartup.sh

To access start startup settings:

gnome-session-properties

enter image description here

gnome-session-properties

press add enter image description here

Now it will start up each time you load your OS.

To test it simply type

sh nvidiaStartup.sh

Hope this helps!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .