屏幕亮度不起作用
我在Sony Vaio(VPCCW2HGX)上使用Ubuntu 12.04。 在第一次,亮度控制效果很好,但激活附加驱动程序(nvidia加速图形驱动程序)后亮度控制不起作用。 我在很多Ubuntu和Linux论坛上搜索过这个问题,但是解决方案不起作用。 我试过这些方法:
- 安装xbacklight
- 将
Option "RegistryDwords" "EnableBrightnessControl=1"
到/etc/X11/xorg.conf
- 更新Nvidia驱动程序
- 要通过键入
sudo setpci -s 00:02.0 F4.B=xx
来尝试更改亮度
所有这些方法都不起作用。 我仍然无法设置屏幕亮度。 有没有人知道这个?
我的Vaio和Ubuntu遇到了同样的问题。
我使用了nvidiabl-module和oBacklight脚本。
该存储库中提供了该脚本, 这些说明可能会有所帮助。
或者使用README文件中描述的基于DKMS的新方法。 如果你使用这种技术,你真的应该彻底阅读该文件。 但是,一个应该工作的方法是下载.deb
文件并安装它。 该项目处于非活动状态,因此nvidiabl-dkms_0.87_all.deb
可能仍将是最新的.deb
软件包 。 您可以使用以下两个命令下载并安装该软件包:
wget https://raw.githubusercontent.com/guillaumezin/nvidiabl/master/install/deb/nvidiabl-dkms_0.87_all.deb sudo dpkg -i nvidiabl-dkms_0.87_all.deb
README提供了有关其他安装和卸载方法的信息。
要获得工作亮度键,请尝试以下操作。
运行命令:
sudo -H gedit /etc/default/grub
改变这一行
GRUB_CMLINE_LINUX_DEFAULT="quiet splash"
到下面这样的东西
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor
执行sudo update-grub
并重启。 查看亮度键是否正常工作。
Ubuntu仍然可能无法记住您的亮度设置。 所以你每次都要改变亮度。
请告诉我们结果,因为许多索尼用户都面临着这个问题。
这是在执行上述步骤后手动设置亮度。
尝试按照ls /sys/class/backlight/*/brightness
显示的路径进行操作,并相应地进行替换。
例如,路径将如下:
/sys/class/backlight/acpi_video0/brightness
对于上述路径获取最大亮度:
cat /sys/class/backlight/acpi_video0/max_brightness
尝试使用较低的值来设置亮度,比如输出为16,所以我会尝试使用其中的一半:
echo 8 | sudo tee /sys/class/backlight/acpi_video0/brightness
如果这样做,请通过执行以下操作在每次登录时自动执行此操作
sudo -H gedit /etc/rc.local
在exit 0
之前输入此行。 它应该看起来像:
echo YOUR_VALUE_HERE > /sys/class/backlight/acpi_video0/brightness exit 0
您也可以尝试使用xdotool
实际上需要grub
和xorg.conf
修改。
首先修改/etc/defaults/grub
以添加ACPI参数。 然后GRUB_CMDLINE_LINUX_DEFAULT
行可能看起来像:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
通过运行以下命令更新GRUB以应用该更改:
sudo update-grub
其次,在/etc/X11/xorg.conf
文件中,找到Device
部分并添加Option EnableBrightnessControl
,如下所示:
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 330M" Option "RegistryDwords" "EnableBrightnessControl=1" EndSection
这适用于配备Nvidia GeForce 330M的三星R780。
对于那些在寻找解决方案时最终到此为止的人,我从这里找到了下面的文本,这适用于我的Ubuntu 12.04 64位。
sudo nano /etc/X11/xorg.conf
这将打开您的X服务器配置(提示输入密码后)。 您应该看到标题为“设备”的部分,如下所示:
Section "Device" Identifier "Default Device" Driver "nvidia" Option "NoLogo" "True" EndSection
添加一行,如下所示:
Section "Device" Identifier "Default Device" Driver "nvidia" Option "NoLogo" "True" Option "RegistryDwords" "EnableBrightnessControl=1" EndSection
您需要重新启动图形服务器(或重新启动)才能使此更改生效。
安装xbacklight:
sudo apt-get install xbacklight
您可以将亮度设置为X%(不需要sudo):
xbacklight -set X
要使设置成为永久设置,请转到启动应用程序并使用以下命令添加新的启动程序(其中X%是您所需的亮度):
xbacklight -set X
正如许多其他人所建议的那样修改/etc/rc.local对我不起作用(在Dell Studio 1535上)。
我使用的是nvidia 970.我编写了一个脚本并映射了键盘快捷键以增加或减少亮度(这使用xrandr):
记得给文件执行权限
chmod +x
file
将以下行添加到键盘快捷键
增加:
filepath/file
--increment
并减少
filepath/file
--decrement
其中file是包含以下脚本的文件的名称:
#!/bin/sh #get the video port to which screen is connected VAR_DISPLAY=`xrandr --verbose | grep " connected"| sed 's/ connected.*//g'` if [ -z $VAR_DISPLAY ] then echo "Err:Display details could not be found using xrandr" exit 1 fi echo $VAR_DISPLAY ## #get the current brightness settings [0 - 1] VAR_BRIGHTNESS=$(xrandr --verbose | grep "Brightness"| sed 's/.*Brightness: //g') if [ -z $VAR_BRIGHTNESS ] then echo "Err:Brightness setting could not be found using xrandr" exit 1 fi ## #increase or decrease brightness if [ -z $1 ] then echo "Specify one of following option --increment | --decrement" else if [ $1 = "--increment" ] then test $( expr `expr "$VAR_BRIGHTNESS + .05"|bc`" > 1"|bc ) -eq 1 || xrandr --output $VAR_DISPLAY --brightness `expr "$VAR_BRIGHTNESS +.05"|bc` else if [ $1 = "--decrement" ] then test $( expr `expr "$VAR_BRIGHTNESS - .05"|bc`" < 0"|bc ) -eq 1 || xrandr --output $VAR_DISPLAY --brightness `expr "$VAR_BRIGHTNESS - .05"|bc` else echo "Specify one of following option --increment | --decrement" fi fi fi ##
我通过以下步骤修复了我的sony vaio F型号#VPCF23EFX:
-
安装Nvidia驱动器
-
运行Nidia x服务器设置,您可以在应用程序菜单中找到它们
-
选择x server display configuration并选择
save to x configuration file
选项。 这将构建文件xorg.conf
并关闭Nvidia x服务器设置。 -
终端中的
sudo gedit /etc/X11/xorg.conf
-
找
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 540M" EndSection
-
像这样改变它
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 540M" Option "RegistryDwords" "EnableBrightnessControl=1" EndSection
-
重启
使用nvidia驱动程序时,使用xbacklight
来控制显示亮度时也遇到了问题。
我发现使用light是最好的通用解决方案,因为它不依赖于xorg配置。
以下是我对dotfiles所做的更改,以便通过键盘快捷键进行安装和使用: https : //github.com/ruebenramirez/.dotfiles/commit/a18fd396a4f53238c7d6d96e3e0d39bdbae2c56c
在使用nvdidia驱动程序时,尝试使用xrandr更改亮度或gamma:
确定显示器的输出名称:
xrandr -q | grep connected
我的显示器名称作为DVI-I-1返回,我使用:
xrandr --output DVI-I-1 --brightness 0.8 --gamma 0.7:0.7:0.7
改变亮度/伽玛
您可以创建运行这些命令的自定义键。