> CentOS > CentOS入门 >

CENTOS 7 手工调节屏幕亮度



新建三个文本文件并给予执行权限:
up.sh

if [ ! -w /sys/class/backlight/intel_backlight/brightness ];then
    echo "password" | sudo -S chmod 777 /sys/class/backlight/intel_backlight/brightness
fi

read bright < '/sys/class/backlight/intel_backlight/brightness'

v=600
v=$((4882 / 20 + $bright))

if [ $v -gt 4882 ]; then
    v=4882
fi

echo $v | tee /sys/class/backlight/intel_backlight/brightness

down.sh

if [ ! -w /sys/class/backlight/intel_backlight/brightness ];then
    echo "password" | sudo -S chmod 777 /sys/class/backlight/intel_backlight/brightness
fi

read bright < '/sys/class/backlight/intel_backlight/brightness'

v=600
v=$(($bright - 4882 / 9 ))

echo $v | tee /sys/class/backlight/intel_backlight/brightness

middle.sh

echo 2441 > /sys/class/backlight/intel_backlight/brightness

使用方法:
提高亮度:
sudo ./up.sh
降低亮度:
sudo ./down.sh
直接调节亮度到50%:
sudo ./middle.sh

(责任编辑:IT)