Page 1 of 2

How to make nvidia-settings sticky

Posted: Sat Jul 14, 2007 4:43 pm
by Husse
This is edited 2007-07-15
This is a problem that has been around some time :)
You change nvidia-settings and after the next boot they are back to default.

Nvidia-settings actually keep your customization but must run for them to take effect.
This guide tells you how to achieve this automatically.
In no part of this guide should you be root - no sudo!
In your ~ folder is a file called .xinitrc
~ is an "alias" for /home/your_name
A dot (.) first in a file name indicates it's a hidden file so you must turn on "Show hidden files" to see it. If it does not exist - create it (text file).
Then add the following

Code: Select all

#!/usr/bin/env bash
/usr/bin/nvidia-settings --load-config-only &
exec gnome-session 
For KDE use

Code: Select all

 exec startkde 
The exec command must be the last command.
Make the file executable

Code: Select all

chmod chmod +x ~/.xinitrc
or use the GUI - right click>Properties>Permissions>Make this file executable
For the xserver to use xinitrc you must create a symlink

Code: Select all

ln -s ~/.xinitrc ~/.xsession
This starts nvidia-settings when you start gnome.

This is all that's needed.
You will have your personal settings for color and more remaining session after session.

This is not about X server Display Configuration but the other settings you find in nvidia-settings
Do not save to xorg.conf from nvidia-settings as all the special settings you may have (Beryl, touchpad etc.) will be removed.
Use the applet for screen resolution in the menu instead

I have read that for some the solution above does not work, and missed the easy solution.
A workaround is to remove --load-config-only
Then nvidia-settings open when gnome starts.
To close nvidia-settings automatically create a hidden file with some name you like in ~. I used ~/.xxx
Add the following to the file:

Code: Select all

#!/usr/bin/env bash
killall /usr/bin/nvidia-settings
Got to the Sessions tab in the menu.
Add a new "Start program" and use the ~/.xxx as target.
nvidia-settings will now close shortly after you see the desktop.
This edit makes Scorp123's remarks below somewhat unnecessary, but they aim at the original posting and are justified.

Posted: Sat Jul 14, 2007 9:28 pm
by scorp123
Why so complicated?? :roll: The "man" page is your friend:

Code: Select all

man nvidia-settings
There we can read interesting things like this:

-l, --load-config-only
Load the configuration file, send the values specified therein to the X server, and exit. This mode of operation is useful to place in your .xinitrc file, for example.


I suggest using that parameter above and taking a closer look at man pages before we freak away users with too complicated suggestions? :lol:

BTW, the man page mentions everything. So why do we need to reinvent the wheel when it's already there in the manual?

Code: Select all

3. Loading Settings Automatically
       The  NVIDIA X driver does not preserve values set with nvidia-settings between runs of the X server (or even between
       logging in and logging out of X, with xdm(1), gdm, or kdm ).  This is intentional, because different users may  have
       different  preferences,  thus  these  settings  are stored on a per-user basis in a configuration file stored in the
       user’s home directory.

       The configuration file is named ~/.nvidia-settings-rc.  You can specify a different configuration file name with the
       --config commandline option.

       After you have run nvidia-settings once and have generated a configuration file, you can then run:

            nvidia-settings --load-config-only

       at  any  time  in the future to upload these settings to the X server again.  For example, you might place the above
       command in your ~/.xinitrc file so that your settings are applied automatically when you log in to X.

       Your .xinitrc file, which controls what X applications should be started when you log into X (or startx), might look
       something like this:

            nvidia-settings --load-config-only &
            xterm &
            evilwm

       or:

            nvidia-settings --load-config-only &
            gnome-session

       If  you  do not already have an ~/.xinitrc file, then chances are that xinit(1) is using a system-wide xinitrc file.
       This system wide file is typically here:

            /etc/X11/xinit/xinitrc

       To use it, but also have nvidia-settings upload your settings, you could create an ~/.xinitrc with the contents:

            nvidia-settings --load-config-only &
            . /etc/X11/xinit/xinitrc
...

Posted: Sun Jul 15, 2007 12:25 am
by nelamvr6
That worked great! Thanks to both of you!

Posted: Sun Jul 15, 2007 3:52 am
by Husse
Why so complicated - published prematurely - and I realize now that I must have been really tired when I pushed the submit button....
Somewhere I read that you needed to start nvidia-settings and I did not check out the --load-config-only :( :)
Hopefully we did not freak away users with too complicated suggestions :):)
This has been asked more than once and sadly I did not take time to investigate until now - it's simple.

Posted: Sun Jul 15, 2007 2:11 pm
by nelamvr6
My setting stick now, thanks a lot!

Posted: Fri Sep 14, 2007 5:38 am
by Husse
@ D-EJ915 No!
That's not it - that's to get the part of nvidia settings you should not! use sticky. The sloution here does not affect the xorg.conf file :)

Re: How to make nvidia-settings sticky

Posted: Fri Sep 21, 2007 6:19 pm
by vinoman
Husse wrote:This is edited 2007-07-15
This is a problem that has been around some time :)
You change nvidia-settings and after the next boot they are back to default.

Nvidia-settings actually keep your customization but must run for them to take effect.
This guide tells you how to achieve this automatically.
In no part of this guide should you be root - no sudo!
In your ~ folder is a file called .xinitrc
~ is an "alias" for /home/your_name
A dot (.) first in a file name indicates it's a hidden file so you must turn on "Show hidden files" to see it. If it does not exist - create it (text file).
Then add the following

Code: Select all

#!/usr/bin/env bash
/usr/bin/nvidia-settings --load-config-only &
exec gnome-session 
For KDE use

Code: Select all

 exec startkde 
The exec command must be the last command.
Make the file executable

Code: Select all

chmod chmod +x ~/.xinitrc
or use the GUI - right click>Properties>Permissions>Make this file executable
For the xserver to use xinitrc you must create a symlink

Code: Select all

ln -s ~/.xinitrc ~/.xsession
This starts nvidia-settings when you start gnome.

This is all that's needed.
You will have your personal settings for color and more remaining session after session.

This is not about X server Display Configuration but the other settings you find in nvidia-settings
Do not save to xorg.conf from nvidia-settings as all the special settings you may have (Beryl, touchpad etc.) will be removed.
Use the applet for screen resolution in the menu instead

I have read that for some the solution above does not work, and missed the easy solution.
A workaround is to remove --load-config-only
Then nvidia-settings open when gnome starts.
To close nvidia-settings automatically create a hidden file with some name you like in ~. I used ~/.xxx
Add the following to the file:

Code: Select all

#!/usr/bin/env bash
killall /usr/bin/nvidia-settings
Got to the Sessions tab in the menu.
Add a new "Start program" and use the ~/.xxx as target.
nvidia-settings will now close shortly after you see the desktop.
This edit makes Scorp123's remarks below somewhat unnecessary, but they aim at the original posting and are justified.
I don't have an .xinitrc file or folder. This is very confusing. Can you simplify these instructions. I just want to set my resolution to 1440x900. It should be so difficult.

Posted: Sun Sep 23, 2007 2:52 pm
by Husse
@ vinoman
Use the screen resolution tool for that - the nvidia settings are not aimed at resolution
If you read the beginning of the howto it says if youd don't have .xinitrc create it

Posted: Sun Sep 23, 2007 9:26 pm
by vinoman
The screen resolution tool didn't let me change settings to 1440x900. That's why I did the nvidia-settings. It worked and now my screen is sharp and clear. None of the instructions made much sense to me. Nobody has been able to explain why doing it the way I did it is so bad.

What if I pull out the nvidia card and go with the on-board Intel video? Would it make a difference?

You should be able to set your resolution simply with the resolution tool no matter what video card you have.

Posted: Mon Sep 24, 2007 6:18 am
by Husse
You should be able to set your resolution simply with the resolution tool no matter what video card you have.
Agreed - this is a point where work has to be done - and is done

Posted: Mon Sep 24, 2007 10:27 am
by vinoman
Will it be offered on Celena?

Posted: Mon Sep 24, 2007 5:14 pm
by Husse
Not in Celena - but perhaps in Daryna (4.0) There will be a lot of work on x in Gutsy and Daryna will be based on gutsy.
But I fear that for the really odd resolutions you may still have to add them in xorg.conf
You should know this is a problem on Windows too (don't know about Mac)

Nvidia color settings don't stick

Posted: Fri Sep 28, 2007 5:02 am
by lancest
Desktop Intel 32. I got the Nvidia custom color settings to start at login but lose them after the power management kicks in.

Posted: Fri Sep 28, 2007 8:40 am
by Stretch
Husse wrote:
You should be able to set your resolution simply with the resolution tool no matter what video card you have.
Agreed - this is a point where work has to be done - and is done
Have you guys grandr ? It's in the repositories. It puts an applet in the panel and allows you to change resolutions on the fly.

Posted: Sat Sep 29, 2007 1:22 pm
by Husse
Stretch - which application? Perhaps better than the one we have in the menu
It was not that we were thinking about, but rather that we should not have to go through editing xorg.conf for some settings that wont appear otherwise even with an applet :)

Posted: Sat Sep 29, 2007 6:37 pm
by Stretch
Perhaps I am not understanding correctly :)

I thought you wanted to change resolution to something that was already in xorg.conf. If all your resolutions are in xorg.conf then great... grandr will switch your desktop to one of those resolutions.

However if you are wanting to change to a resolution NOT in xorg.conf, then I don't know of any other way.


grandr is an applet for GNOME panel.

Posted: Sun Sep 30, 2007 7:45 am
by Husse
I did not read the post again but if I'm correct the problem where we wanted something better was for e.g. the people with wide screen resolutions (1440x900 and the like) that finds themselves having problems getting this resolution
For me and you it's not all that hard to edit xorg.conf so we get it working - but for noobs coming from Windows....

Re: How to make nvidia-settings sticky

Posted: Fri Mar 14, 2008 8:58 am
by drifter
I am a linux newbie. Only had Mint for about a month. Here is the fix that I found to be easiest for myself and it works without any problems.
I noticed that after changing Nvidia settings the program was not able to update the /etc/X11/xorg.conf file.
So what I do is this: I change my settings so that everything is perfect for my setup then I apply settings and select the update xorg.conf button but I dont update. I look at the preveiw that it itends to write to the file. I copy the preveiw and then us nano to completly replace the xorg.conf file with the preveiw (update).
For me this is the easiest and it works great. That is how I configured twinview.

Re: How to make nvidia-settings sticky

Posted: Mon Jul 20, 2009 1:45 pm
by Husse
create a symlink
That's the same as Right click > Make link :)
I have stopped using nvidia (mostly) but I think it's sufficient to run nvidia-settings as root now, but perhaps this is still needed for gamma etc

Re: How to make nvidia-settings sticky

Posted: Sun Aug 23, 2009 11:16 am
by Egorama
Great post! That's one more niggle nailed.