Ubuntu设置开机时的屏幕亮度

      如果,你的Ubuntu系统每次开机之后屏幕都特别亮,那么别怀疑,你不是第一个发现这个问题的人~~本文简要介绍如何解决这个问题。

      主要参考:http://askubuntu.com/questions/66751/how-do-i-set-default-display-brightness

      英语不好的看这边。本解决方法只针对12.04, 12.10, 13.10, 14.04, 14.10。

      方法一:设置 /sys/class/backlight/acpi_video0/brightness或者/sys/class/backlight/intel_backlight/brightness

         这种方法请参考 http://blog.youkuaiyun.com/arthur_killer/article/details/44523559 或者 http://www.linuxidc.com/Linux/2016-01/128043.htm

      方法二: 在终端下,执行如下脚本(直接复制粘贴并运行,或者建立一个sh脚本再运行都OK)

 

# Install xbacklight in case it is not already installed (small).
sudo apt-get install xbacklight
# You should test xbacklight with command-line to see if it works. For example:
# xbacklight = 100 ; sleep 2 ; xbacklight = 30
# Try to figure out a suitable value for your hardware and lighting conditions.

# This creates a small script running xbacklight.
# You can change the =30 into another value if you wish. 
# The "|| true" ensures that if xbacklight fails for any reason, X can still start.
sudo bash -c '{
echo "#!/bin/bash"
echo "xbacklight =30 || true"
} >> /etc/lightdm/display-setup-script.sh '

# This makes that script executable
sudo chmod a+rx /etc/lightdm/display-setup-script.sh

# This instructs lightdm to run the script when starting X.
# Specifically, it adds a line display-setup-script in a lightdm configuration file/, but only if there is not one already.
if grep -ri ^display-setup-script /etc/lightdm/
then 
  echo "There may be already a display-setup-script. It may already do what you need. Else please adjust manually" ; 
else 
  if [[ -d /etc/lightdm/lightdm.conf.d ]]
  then
    # Ubuntu 13.10 and above have lightdm.conf.d. 14.04 *only* have lightdm.conf.d
    DESTCONFFILE=/etc/lightdm/lightdm.conf.d/20-default-brightness.conf
  else
    # Ubuntu 12.04, 12.10, 14.10 do not have lightdm.conf.d, we change main configuration file
    DESTCONFFILE=/etc/lightdm/lightdm.conf
  fi
  echo "Writing into $DESTCONFFILE"
  sudo bash -c "{ echo '[SeatDefaults]' ; echo display-setup-script=/etc/lightdm/display-setup-script.sh ; } >>$DESTCONFFILE" ; 
fi
  在我自己的 Ubuntu 14.04 上面,第一种方法无效,第二种方法有效。 祝你好运!

<think>好的,我现在需要帮助用户解决Ubuntu 20.04屏幕亮度无法调节的问题。根据用户提供的引用内容,我需要整理出可行的解决方案。首先,用户提到了几种不同的方法,比如升级内核、修改GRUB参数、安装NVIDIA驱动以及BIOS设置。我需要先理清这些步骤的逻辑顺序,确保方法正确且安全。 首先,用户引用[1]提到通过升级内核解决了问题。升级内核可能涉及一定的风险,但通常是最直接的方法,尤其是对于较新的硬件。不过,用户引用[3]和[4]也提到了修改GRUB参数和BIOS设置,这可能与显卡驱动有关。此外,引用[2]和[3]都提到了NVIDIA驱动的安装,这可能是因为双显卡导致的亮度调节问题。 接下来,我需要确定这些方法的优先级。通常,修改GRUB参数和更新驱动是比较简单的步骤,应该先尝试。如果无效,再考虑升级内核,因为升级内核可能需要更多的操作,并且可能导致其他兼容性问题。BIOS设置也是一个可能的因素,特别是关闭Secure Boot或调整显卡模式。 另外,用户引用[3]中的步骤涉及BIOS设置,比如关闭Secure Boot和调整显卡输出模式。这可能影响系统的启动和硬件兼容性,需要谨慎操作。同,引用[4]提到触摸板问题在解决亮度问题后出现,但当前问题不涉及触摸板,所以暂不需要考虑。 还要注意,不同的硬件可能需要不同的处理方法。例如,联想拯救者可能需要特定的BIOS设置,而其他品牌可能不需要。用户提供的引用中有多个联想型号,可能需要特别关注联想笔记本的解决方案。 总结可能的解决步骤: 1. 修改GRUB参数,添加i915.enable_psr=0或nomodeset。 2. 安装或更新NVIDIA驱动,并禁用nouveau驱动。 3. 升级Linux内核到较新版本。 4. 调整BIOS设置,如关闭Secure Boot,切换显卡模式。 需要逐步指导用户按照这些步骤尝试,并提醒备份重要数据,避免操作失误导致系统问题。同,需要检查每个步骤后的效果,如果问题仍未解决,再进行下一步。还要注意命令的正确性,比如使用sudo权限,正确编辑配置文件等。</think>以下是解决Ubuntu 20.04屏幕亮度调节功能失效的分步方案: ### 一、修改GRUB参数(优先尝试) 1. 打开终端执行: ```bash sudo gedit /etc/default/grub ``` 2. 找到`GRUB_CMDLINE_LINUX_DEFAULT`行,修改为: ``` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.enable_psr=0" ``` 或尝试其他参数组合: ``` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor" ``` 3. 更新GRUB并重启: ```bash sudo update-grub && sudo reboot ``` 该方法通过调整显卡参数解决兼容性问题[^2][^3]。 ### 二、安装NVIDIA闭源驱动 1. 禁用默认驱动: ```bash sudo gedit /etc/modprobe.d/blacklist.conf ``` 添加两行: ``` blacklist nouveau options nouveau modeset=0 ``` 2. 更新并重启: ```bash sudo update-initramfs -u && sudo reboot ``` 3. 通过`软件和更新`或命令行安装推荐驱动: ```bash sudo ubuntu-drivers autoinstall ``` 双显卡设备需要正确配置驱动以支持亮度调节[^3]。 ### 三、升级Linux内核(前两步无效使用) 1. 查看当前内核版本: ```bash uname -r ``` 2. 安装5.13+版本内核: ```bash sudo apt install linux-generic-hwe-20.04 ``` 或手动下载更高版本内核头文件: ```bash sudo apt install linux-headers-5.15.0-xx-generic linux-image-5.15.0-xx-generic ``` 3. 重启后验证: ```bash uname -r ``` 新版内核可改善硬件兼容性[^1][^4]。 ### 四、BIOS设置调整 1. 开机按F2/Del进入BIOS 2. 关键设置项: - 关闭`Secure Boot` - 禁用`Legacy Support` - 显卡模式改为`独显直连`或`混合模式` 3. 保存设置后重装系统驱动
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值