底下寫了一個簡單的Script來修改這設定值:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/bin/sh if [ $# -ne 1 ]; then echo "Usage: $0 <back light percent>" echo "Example: $0 100: Set back light to maximum" exit 1 fi percent=$1 for acpi in /sys/class/backlight/acpi_video* do max=`cat ${acpi}/max_brightness` val=$((max*percent/100)) sudo sed -i "/exit 0$/i echo $val > ${acpi}/brightness" /etc/rc.local done |
使用方式如下:
- ./set_backlight.sh 100:背光調成最亮
- ./set_backlight.sh 0:關掉背光
根據觀察在Notebook上會有兩組設定值,分別是acpi_video0與acpi_video1,acpi_video0是插上電源線會參考的數值,而acpi_video1是沒接電源線參考的數值,不過沒找到相關說明文件不是很確認這兩者的區別。
沒有留言:
張貼留言