1. In a terminal window, type in:
Code:
mousepad ./backlight_d.sh
2. Copy and paste the following into the mousepad application that just opened:
Quote:
#!/bin/bash old_b=9; declare -i curr_b=240; declare -i target_b=240; while : ; do b=`cat /sys/class/backlight/acpi_video0/brightness`; delay="0.5" if [ $old_b != $b ]; then old_b=$b let "target_b=$b * 20 + 12" #printf "Target: %10d\n" $target_b fi hex_b="."; if [ "$curr_b" -lt "$target_b" ] ; then let "curr_b=$curr_b + 2" if [ "$curr_b" -gt "$target_b" ] ; then let "curr_b=$target_b" fi hex_b="-" elif [ "$curr_b" -gt "$target_b" ] ; then let "curr_b=$curr_b - 2" if [ "$curr_b" -lt "$target_b" ] ; then let "curr_b=$target_b" fi hex_b="-" fi if [ $hex_b != "." ] ; then hex_b=`printf "%02X" $curr_b` delay="0.005" setpci -s 00:02.0 F4.B=$hex_b fi sleep $delay done |
Code:
File->Save(save it through closing it)
Code:
sudo cp ./backlight_d.sh /etc/ && sudo chmod +x /etc/backlight_d.sh
5. Enter the following into the terminal window:
Code:
sudo mousepad /etc/rc.local
Code:
nohup /etc/backlight_d.sh &
Quote:
nohup /etc/backlight_d.sh & exit 0 |
U can use gedit instead of mousepad
ReplyDelete