重启后无法保存屏幕的nvidia设置

我有两个屏幕,有时我只想要显示27“。到目前为止,我已经尝试将nvidia-settings设置为

sudo -s nvidia-settings 

但每次我重新启动我都要重做我的偏好..我的笔记本电脑是asus g75vw nvidia驱动程序版本是:331.38 Ubuntu 14.04

我试过新的驱动程序,没有任何改变现在标准设置使屏幕重复…

有没有其他简单的方法我可以设置设置在重启后持续存在?

nvidia设置

x配置文件

  # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 337.12 (buildd@charichuelo) Wed Apr 9 12:25:02 UTC 2014 # nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 331.38 (buildmeister@swio-display-x64-rhel04-15) Wed Jan 8 19:53:14 PST 2014 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "Samsung S27C590" HorizSync 30.0 - 81.0 VertRefresh 50.0 - 75.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 670M" Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefault=0x2; PowerMizerDefaultAC=0x2" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-2" Option "metamodes" "HDMI-0: nvidia-auto-select +0+0" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection 

Xrand给了我

  $ sudo xrandr Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 16384 x 16384 VGA-0 disconnected (normal left inverted right x axis y axis) LVDS-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 382mm x 215mm 1920x1080 60.0*+ 40.0 DP-0 disconnected (normal left inverted right x axis y axis) HD MI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm 1920x1080 60.0*+ 59.9 50.0 1680x1050 60.0 1600x900 60.0 1440x900 59.9 1280x1024 75.0 60.0 1280x800 59.8 1280x720 60.0 59.9 50.0 1152x864 75.0 1024x768 75.0 70.1 60.0 800x600 75.0 72.2 60.3 56.2 720x576 50.0 720x480 59.9 640x480 75.0 72.8 59.9 DP-1 disconnected (normal left inverted right x axis y axis) 

最简单的方法是以root身份运行nvidia-settings

 sudo nvidia-settings 

您现在可以使用“保存到X配置文件”按钮。

或者,您可以简单地将生成的文件保存为/etc/X11/xorg.conf但不要在您的问题中使用该文件。 那个是不完整的,大概是因为你没有复制整件事。


好像有什么东西会覆盖你的xorg.conf文件。 作为(不优雅的)解决方法,您可以使用xrandr不带 sudo )来激活/停用您的屏幕:

  1. 要停用第二个屏幕并仅使用主监视器:

     xrandr --output LVDS-0 --off 
  2. 要激活它:

     xrandr --output HDMI-0 --auto --primary --output LVDS-0 --mode 1920x1080 --right-of HDMI-0 

    重要提示 :如果您的屏幕标识符为MI-0HD MI-0我不确定您的xrandr输出。 我从未见过包含空格的标识符,这就是我使用前者的原因,但您可能需要使用xrandr --output "HD LVDS-0" --auto --right-of MI-0

如果这些命令成功切换到您想要的布局(如果没有,让我知道,我们可以调整它们),您可以将它们变成一个简单的脚本:

 #!/usr/bin/env bash if [[ $1 = "off" ]]; then xrandr --output LVDS-0 --off else xrandr --output HDMI-0 --auto --primary --output LVDS-0 --mode 1920x1080 --right-of HDMI-0 fi 

将其保存为switch_screens.sh并使其可执行( chmod +x switch_screens.sh )。 您现在可以从GUI进入设置,转到“键盘”=>“快捷方式”并为每个命令创建自定义快捷方式:

在此处输入图像描述

并关闭它,将“命令”设置为~/switch_screens.sh off

在此处输入图像描述

选择您想要的任何快捷键组合,然后您可以随意激活/停用屏幕。

您也可以直接从终端激活它:

 ~/switch_screens.sh 

然后停用它

 ~/switch_screens.sh off 

这在Ubuntu 17.04上对我有用:

  1. sudo nvidia-settings并更改你想要的任何设置,
  2. /etc/X11/xorg.conf保存nvidia xorg配置
  3. 转到ubuntu Settings -> Displays并单击应用按钮(如果禁用该按钮,尝试进行一些虚拟修改)。

3号可能听起来很傻,但这就是拯救我的原因。

当您单击“保存到X配置文件”时是否会出错?

做这个:

将生成的X文件中的文本复制/粘贴到桌面上名为xorg.conf的文件中

然后在终端中,执行:

 sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old sudo mv /home/%user/Desktop/xorg.conf /etc/x11/xorg.conf 

其中%user是您的用户名。

如果这会破坏任何内容,请放到TTY(通过按CTRL + ALT + F1)并执行:

 sudo rm /etc/X11/xorg.conf sudo cp /etc/X11/xorg.conf.old /etc/X11/xorg.conf 

这至少会让你回到现在的位置。

在我的情况下,这工作:

  • 更新到软件和更新>其他驱动程序中的最新驱动程序
  • 重新启动并打开BIOS配置菜单(输入此内容因制造商而异(在我的情况下,HP,在启动时反复按Esc将我带到系统配置菜单)
  • 在启动设置下禁用SECURE BOOT
  • 重启到Ubuntu
  • 完成!