为什么 NVIDIA X 服务器设置配置在重新启动时无法保存?

为什么 NVIDIA X 服务器设置配置在重新启动时无法保存?

我在一台运行 Debian 8.2“Jessie”和 MATE 桌面环境的 64 位计算机上。

我有一张 Geforce GTX 650ti 显卡。

我以名为“john”的非超级用户帐户登录。

我打开 NVIDIA X Server 设置 GUI,将显示器的亮度从 0.000 更改为 -0.1,转到“nvidia-settings 配置”部分,单击“保存当前配置”,然后单击“退出”。

但当我重新启动时,亮度又回到 0.000。

为什么?

我该如何解决?

答案1

我发现向不同的 x11 配置添加行的方法在我的情况下是无效的。作为替代方案,我创建了一个 bash 脚本,该脚本在登录时自动应用我的设置。很简单,我只是从保存的文件中获取了我所做的更改xconf,这基本上使我们达到了预期的目的。这不是最优雅的方法,但它有效......

下面的文件是我的显示器设置,您需要将您自己的信息放在我的信息之上。

我个人的解决方案是将这些行直接添加到.bashrc

nvidia-settings --load-config-only
nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select +0+54, HDMI-0: nvidia-auto-select +1600+0 {viewportout=1792x1008+65+30}"

我的原始有效答案经过编辑,建议将其放入单独的文件中,而不是在.bashrc.两者都有效。但是,我希望答案能够反映这两种方法。

bash 脚本示例:

# Save this to some script.sh
nvidia-settings --load-config-only
nvidia-settings --assign CurrentMetaMode="DVI-I-1: nvidia-auto-select +0+54, HDMI-0: nvidia-auto-select +1600+0 {viewportout=1792x1008+65+30}"

接下来,编辑.bashrc.bash_profile(无论您喜欢哪个)并在其中添加脚本,以便它在登录时自动运行。

最后,使你的脚本可执行chmod +x script.sh

答案2

它不会自动使用此配置,而是您必须手动加载它,例如通过自述文件中显示的方法之一,或者您自己最喜欢的在登录时启动某些内容的方式。您正在寻找的命令是nvidia-settings --load-config-only.

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

System administrators may choose to place the nvidia-settings load
command directly in the system xinitrc script.

Please see the xinit(1) manpage for further details of configuring
your ~/.xinitrc file.

来源:ftp://download.nvidia.com/XFree86/Linux-x86_64/1.0-6106/nvidia-settings-user-guide.txt

相关内容