How to make nvidia-settings sticky

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

How to make nvidia-settings sticky

Postby Husse » Sat Jul 14, 2007 4:43 pm

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.
Last edited by xenopeek on Thu Mar 15, 2012 4:44 am, edited 4 times in total.
Reason: Unstickied
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

User avatar
scorp123
Level 8
Level 8
Posts: 2277
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Postby scorp123 » Sat Jul 14, 2007 9:28 pm

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
...

nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Postby nelamvr6 » Sun Jul 15, 2007 12:25 am

That worked great! Thanks to both of you!

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Sun Jul 15, 2007 3:52 am

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.
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

nelamvr6
Level 4
Level 4
Posts: 327
Joined: Sun Jul 08, 2007 8:14 pm
Location: New London, CT USA

Postby nelamvr6 » Sun Jul 15, 2007 2:11 pm

My setting stick now, thanks a lot!

User avatar
D-EJ915
Level 2
Level 2
Posts: 70
Joined: Fri Jun 29, 2007 2:14 am
Location: Virginia, USA
Contact:

Postby D-EJ915 » Fri Sep 14, 2007 1:33 am

I noticed an easier way (this was on ubuntu but should work since it's just the x config file)...

anyway, just run nvidia-settings as root, you can then "save configuration to file" and it'll never ever change, lol.

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Fri Sep 14, 2007 5:38 am

@ 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 :)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

vinoman
Level 5
Level 5
Posts: 532
Joined: Wed Sep 05, 2007 8:46 am

Re: How to make nvidia-settings sticky

Postby vinoman » Fri Sep 21, 2007 6:19 pm

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.

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Sun Sep 23, 2007 2:52 pm

@ 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
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

vinoman
Level 5
Level 5
Posts: 532
Joined: Wed Sep 05, 2007 8:46 am

Postby vinoman » Sun Sep 23, 2007 9:26 pm

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.

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Mon Sep 24, 2007 6:18 am

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
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

vinoman
Level 5
Level 5
Posts: 532
Joined: Wed Sep 05, 2007 8:46 am

Postby vinoman » Mon Sep 24, 2007 10:27 am

Will it be offered on Celena?

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Mon Sep 24, 2007 5:14 pm

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)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

lancest
Level 1
Level 1
Posts: 12
Joined: Sat Mar 03, 2007 8:17 am
Location: Guangzhou, China

Nvidia color settings don't stick

Postby lancest » Fri Sep 28, 2007 5:02 am

Desktop Intel 32. I got the Nvidia custom color settings to start at login but lose them after the power management kicks in.

User avatar
Stretch
Level 2
Level 2
Posts: 76
Joined: Sun Sep 09, 2007 6:19 pm

Postby Stretch » Fri Sep 28, 2007 8:40 am

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.

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Sat Sep 29, 2007 1:22 pm

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 :)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

User avatar
Stretch
Level 2
Level 2
Posts: 76
Joined: Sun Sep 09, 2007 6:19 pm

Postby Stretch » Sat Sep 29, 2007 6:37 pm

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.

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Postby Husse » Sun Sep 30, 2007 7:45 am

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....
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

drifter
Level 1
Level 1
Posts: 8
Joined: Mon Feb 18, 2008 7:58 pm

Re: How to make nvidia-settings sticky

Postby drifter » Fri Mar 14, 2008 8:58 am

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.

prongs2
Level 1
Level 1
Posts: 1
Joined: Mon Jul 20, 2009 10:43 am

Re: How to make nvidia-settings sticky

Postby prongs2 » Mon Jul 20, 2009 10:46 am

Husse wrote: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.



what does this mean?? Do i have to add this in the file?? :oops:


Return to “Tutorials”