← Back to team overview

asus-ul30 team mailing list archive

Re: Function keys for to control LCD brightness

 

Which PPA would that be? I'm very interested in getting my screen to stop flickering, but not at the price of 60% brightness.

I've been to: https://launchpad.net/~asus-ul30 <https://launchpad.net/%7Easus-ul30>

And it is of little help to me, it just looks like multiplayer notepad where some markup is there, but most isn't.

On 05/11/2010 05:19 AM, Bill Broadley wrote:

I recently realized that the LCD brightness used with the setpci command isn't 0-99, but instead 0-FF.

Strangely for every time I hit the dim/bright key the /etc/acpi/asus-brn-down/up.sh is called 3 times. Alas the proper step (16) isn't divisible by 3. Instead of messing with floating point I just made the value bounce off the upper/lower limits cleanly.

Is it expected that the up/down scripts would be called 3 times per keypress of Fn-f5 and Fn-f6?

I'm using the 2.6.34 PPA kernel and GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

The new improved script should allow control over the full range of the LCD and be rather close to the scale shown by the brightness dialog:


#!/bin/bash
export SEED=6
if [ ! -f ~/.brightness ]; then
    echo 99 > ~/.brightness;
fi
export BRIGHTNESS=`cat ~/.brightness`
case "$1" in
        "up")
                export BRIGHTNESS=$[$BRIGHTNESS+$SEED];
        ;;
        "down")
                export BRIGHTNESS=$[$BRIGHTNESS-$SEED];
        ;;
        *)
                export BRIGHTNESS=1;
        ;;
esac
if [ "$BRIGHTNESS" -gt "255" ]; then
    export BRIGHTNESS=255;
fi
if [ "$BRIGHTNESS" -lt "0" ]; then
    export BRIGHTNESS=0;
fi
echo $BRIGHTNESS > ~/.brightness
export hexbright=`/usr/bin/printf "%X" $BRIGHTNESS`
sudo setpci -s 00:02.0 F4.B=$hexbright


_______________________________________________
Mailing list: https://launchpad.net/~asus-ul30
Post to     : asus-ul30@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~asus-ul30
More help   : https://help.launchpad.net/ListHelp


Follow ups

References