2024年10月Ubuntu调整及保存屏幕亮度失败怎么办?

发布时间:

  ⑴在Ubuntu系统中,有时会因为屏幕太亮或太暗需要调节屏幕亮度, 却发现屏幕亮度无法调整,或调整后无法保存,遇到这种问题该如何解决呢?

  ⑵Acer Aspire G

  ⑶NVIDIA GeForce GTM

  ⑷Ubuntu . x_

  ⑸其他情况解决方法类似。

  ⑹Fn不能调节屏幕的亮度。因为fn调节的是/sys/class/backlight/acpi_video/brightness文件,而I卡的文件是/sys/class/backlight/intel_backlight/brightness。

  ⑺启动系统,出现grub菜单时,按“e”编辑,在有linux内核路径那一行,添加“acpi_backlight=vendor”,如:

  ⑻linux /boot/vmlinuz-..--generic root=UUID=cbe-e-a-b-fadff ro acpi_backlight=vendor quiet splash

  ⑼如果能正常启动,且用fn能调节屏幕亮度,说明成功,接着下一步。

  ⑽二、修改grub

  ⑾sudo vi /etc/default/grub

  ⑿GRUB_CMDLINE_LINUX=“”

  ⒀GRUB_CMDLINE_LINUX=“acpi_backlight=vendor“

  ⒁我的grub文件如下:

  ⒂# If you change this file, run ‘update-grub’ afterwards to update

  ⒃# /boot/grub/grub.cfg.

  ⒄# For full documentation of the options in this file, see:

  ⒅# info -f grub -n ‘Simple configuration’

  ⒆GRUB_DEFAULT=

  ⒇#GRUB_HIDDEN_TIMEOUT=

  ⒈GRUB_HIDDEN_TIMEOUT_QUIET=true

  ⒉GRUB_TIMEOUT=

  ⒊GRUB_DISTRIBUTOR=`lsb_release -i -s 》 /dev/null || echo Debian`

  ⒋GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash“

  ⒌GRUB_CMDLINE_LINUX=”acpi_backlight=vendor“

  ⒍# Unment to enable BadRAM filtering, modify to suit your needs

  ⒎# This works with Linux (no patch required and with any kernel that obtains

  ⒏# the memory map information from GRUB (GNU Mach, kernel of FreeBSD 。。。

  ⒐#GRUB_BADRAM=”x,xfefefefe,xabcdef,xefefefef“

  ⒑# Unment to disable graphical terminal (grub-pc only

  ⒒#GRUB_TERMINAL=console

  ⒓# The resolution used on graphical terminal

  ⒔# note that you can use only modes which your graphic card supports via VBE

  ⒕# you can see them in real GRUB with the mand `vbeinfo‘

  ⒖#GRUB_GFXMODE=x

  ⒗# Unment if you don’t want GRUB to pass ”root=UUID=xxx“ parameter to Linux

  ⒘#GRUB_DISABLE_LINUX_UUID=true

  ⒙# Unment to disable generation of recovery mode menu entries

  ⒚#GRUB_DISABLE_RECOVERY=”true“

  ⒛# Unment to get a beep at grub start

  ①#GRUB_INIT_TUNE=” “

  ②更新grub.cfg

  ③? ~ sudo update-grub

  ④查看grub.cfg 发现其中每个启动项都加入了“acpi_backlight=vendor”

  ⑤? ~ vi /boot/grub/grub.cfg

  ⑥设定屏幕初始亮度

  ⑦重启后发现,屏幕亮度又恢复为最大亮度。

  ⑧查看影响屏幕亮度的文件

  ⑨? ~ vi /sys/class/backlight/intel_backlight/brightness

  ⑩调节几次屏幕亮度发现其中数值会改变,我的笔记本数值范围为~。

  Ⅰ手动修改该数值,会发现屏幕亮度随之改变(需要root用户执行:

  ⅡPassword:

  Ⅲroot :/home/congbo# echo 》 /sys/class/backlight/intel_backlight/brightness

  Ⅳ因此,将该语句添加到 /etc/rc.local 就能开机自动设定屏幕初始亮度了。

  Ⅴ修改/etc/rc.local如下(需要root用户执行:

  Ⅵ#!/bin/sh -e

  Ⅶ# rc.local

  Ⅷ# This script is executed at the end of each multiuser runlevel.

  Ⅸ# Make sure that the script will “exit ″ on suess or any other

  Ⅹ# value on error.

  ㈠# In order to enable or disable this script just change the execution

  ㈡# By default this script does nothing.

  ㈢echo 》 /sys/class/backlight/intel_backlight/brightness

  ㈣调节gamma值

  ㈤? ~ xgamma -gamma .

  ㈥-》 Red ., Green ., Blue .

  ㈦《- Red ., Green ., Blue .

  ㈧上面就是Ubuntu调节及保存屏幕亮度失败的解决方法了,出现这种问题的时候,先测试代码,再修改grub即可。