Linux 笔记本背光自动调整
Ubuntu Linux 下笔记本背光不会保存,而且插电不插电没啥明显区别,当然并不是不行,有脚本可以解决。
for i in /sys/class/backlight/*; do echo $i; cat $i/brightness; cat $i/max_brightness; cat $i/actual_brightness; done
找寻你的背光控制目录。
/sys/class/backlight/intel_backlight
350 <--- brightness
848 <--- max_brighntess
350 <--- actual_brightness
对我来说 350 亮度刚好,可以自己测试数值。
echo 200 | sudo tee /sys/class/backlight/intel_backlight/brightness
最后创建脚本:
gksu gedit /etc/pm/power.d/zzzbattery
内容里的亮度自己替换,路径也是。
#!/bin/bash
case $1 in
true) #on battery
echo 350 > /sys/class/backlight/intel_backlight/brightness
;;
false) #on ac
echo 800 > /sys/class/backlight/intel_backlight/brightness
;;
esac
参考:Thread: Screen doesn't dim when power switches to battery