Ubuntu手动实现显示屏背光调节
Ubuntu 9.04版时,SONY笔记本不能调节背光,通过修改/proc/acpi/video/VGA/LCD/brightness数值来调节背光,并通过acpi/events绑定热键。
强制手工调节方式
cat /proc/acpi/video/VGA/LCD/brightness echo 70 |sudo tee /proc/acpi/video/VGA/LCD/brightness
Sony VPCEA28EC设置自动背光调节
-
设置热键绑定
cat > /etc/acpi/events/sony-brightness-down <<EOF event=sony/hotkey (SPIC|SNC) 00000001 00000010 action=/etc/acpi/sony-brn-updown.sh down EOF cat > /etc/acpi/events/sony-brightness-up <<EOF event=sony/hotkey (SPIC|SNC) 00000001 00000011 action=/etc/acpi/sony-brn-updown.sh up EOF
-
调节脚本:/etc/acpi/sony-brn-updown.sh
#!/bin/sh #levels: 5 8 11 16 23 34 48 70 100 #current: 70 current=`cat /proc/acpi/video/VGA/LCD/brightness |grep current|awk '{print $2}'` #echo "current=$current" #>>/tmp/test new=100 case "$current" in 5) [ "$1" = "down" ] && new=5 [ "$1" = "up" ] && new=8 ;; 8) [ "$1" = "down" ] && new=5 [ "$1" = "up" ] && new=11 ;; 11) [ "$1" = "down" ] && new=8 [ "$1" = "up" ] && new=16 ;; 16) [ "$1" = "down" ] && new=11 [ "$1" = "up" ] && new=23 ;; 23) [ "$1" = "down" ] && new=16 [ "$1" = "up" ] && new=34 ;; 34) [ "$1" = "down" ] && new=23 [ "$1" = "up" ] && new=48 ;; 48) [ "$1" = "down" ] && new=34 [ "$1" = "up" ] && new=70 ;; 70) [ "$1" = "down" ] && new=48 [ "$1" = "up" ] && new=100 ;; 100|*) [ "$1" = "up" ] && new=100 [ "$1" = "down" ] && new=70 ;; esac #echo "new=$new" #>>/tmp/test [ "$new" != "$current" ] && echo "$new" > /proc/acpi/video/VGA/LCD/brightness exit 0
-
启用
sudo chmod +x /etc/acpi/sony-brn-updown.sh sudo /etc/init.d/acpi-support restart sudo /etc/init.d/acpid restart