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.csdn.net/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 上面,第一种方法无效,第二种方法有效。 祝你好运!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值