Tuesday 4 May 2010

Brightness keys UL30VT Ubuntu 10.04

Seen in ubuntuforums.org:
Scratch from myself: Brightness Key ASUS UL30VT
  1. Make a file called brightness under /bin or /usr/bin and give an executed permission on it.
    this the code:

    1. #!/bin/bash   
    2. export SEED=7   
    3. export BRIGHTNESS=`cat ~/.brightness`   
    4. case "$1" in   
    5.         "up")   
    6.                 export BRIGHTNESS=$[$BRIGHTNESS+$SEED];   
    7.         ;;   
    8.         "down")   
    9.                 export BRIGHTNESS=$[$BRIGHTNESS-$SEED];   
    10.         ;;   
    11.         *)   
    12.                 export BRIGHTNESS=1;   
    13.         ;;   
    14. esac   
    15. if [ "$BRIGHTNESS" -gt "0" ]; then   
    16.         echo $BRIGHTNESS > ~/.brightness   
    17.         sudo setpci -s 00:02.0 F4.B=$BRIGHTNESS   
    18. fi   
    19. if [ "$BRIGHTNESS" -lt "0" ]; then   
    20.         echo "This makes your screen off";   
    21. fi  
  2. Then append brightness up to /etc/acpi/asus-brn-down.sh and brightness down to /etc/acpi/asus-brn-down.sh you could use this command
    sudo echo "brightness up" > /etc/acpi/asus-brn-up.sh
    sudo echo "brightness down" > /etc/acpi/asus-brn-down.sh
  3. Then try to push your Fn+F5 again...
  4. hahaha it's darked.
it's tested on ubuntu 10.04 LTS and ASUS UL30VT


No comments:

Post a Comment