nvidia-settings permanence

aPpYe

New Member
Joined
Nov 22, 2021
Messages
2
Reaction score
1
Credits
26
I apologize if this has been answered before. I have seen this all over the internet. Changes made to the nvidia-settings app do not persist across reboots. They can be made "permanent" by loading the config file (nvidia-settings -l) at startup. This is all well and good so far.

My computer is connected directly to a TV. When the TV is powered off and then back on, the settings are once again lost. Reloading the config file brings things back, but is there a way to automate this? Perhaps some event or property I can monitor with a script? Clearly, the computer knows when the TV is power cycled, because settings are consistently back to default even with a quick power cycle.

I'm running Debian Bullseye ...
 


Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
2,214
Reaction score
1,080
Credits
11,329
I'm not an expert at this by any stretch of the imagination but I do have an idea.
I've manipulated a few config files in my day but this task has to be well mastered.

If you can tweak that configuration file with 'just the right argument' it it should stop going back to the default.

What is the name of that config file?
 
OP
A

aPpYe

New Member
Joined
Nov 22, 2021
Messages
2
Reaction score
1
Credits
26
Heh ... the nvidia defaults to a very low gamma/contrast/brightness level in every instance I have dealt with it. Odd choices by nvidia I think. It comes with the "nvidia-settings" utility, which allows one to adjust these things. The issue (apparently by design), is that settings are not saved across sessions, or even across sleep/resume cycles. One must manually reload the config (nvidia-settings -l) every time. I'm sure they have their reasons. Maybe there's a better way, but I came up with this hacky script I put in Cinnamon startup to make it work for now:

Bash:
#!/bin/bash

if [[ $(lsmod | grep 'nvidia') ]]; then

 nvidia-settings -l

 while true; do
  ( tail -f -n0 ~/.xsession-errors & ) | grep -q "hotplug or laptop lid event"
  sleep 13
  nvidia-settings -l
 done

fi

The sleep is not necessary, but like the satisfaction of watching it happen every time ...
 
Last edited:

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
4,498
Reaction score
3,205
Credits
32,633
I don't have an Nvidia graphics card anymore but what I used to do when I still had one, I ran nvidia-settings with sudo and then saved the the file to /etc/X11/xorg.conf which always worked for me.
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top