新建三个文本文件并给予执行权限: 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
使用方法: |