# backlight apps and nvidia

## Kvetch

I have an HP 8530w with an nVidia VGA card and am trying to get the brightness keys working.  The Gento Wiki entry for the HP-8530w mentions the Brightness but never shows what they set their keyboard mapping to.  I can't seem to get xbacklight working and it doesn't seem to support nVidia.  Acpitool only works with Toshiba, Asus and Thinkpads.  I can however echo [1-10] to /sys/devices/virtual/backlight/acpi_video0/brightness to increase/decrease.  I suppose I could write a small script to handle increasing and decrease by a set amount but only root has write access to this file and I wasn't sure how well of a work around chmod'ing it would be.

Does anyone know an app or cmd I can use to adjust the brightness on an HP 8530w with an nVidia G96M Quadro FX 770M?

Thanks

----------

## Telemin

I assume you are meaning in the console?

I haven't bothered to get my function keys working but I use the following bash script to control the backlight from the console:

setlight

```

#!/bin/bash

calledname=`basename $0`

currentlevel=`cat /sys/devices/virtual/backlight/acpi_video0/brightness`

maxbrightness=`cat /sys/devices/virtual/backlight/acpi_video0/max_brightness`

case "$calledname" in

"lup")

        echo "$maxbrightness" > /sys/devices/virtual/backlight/acpi_video0/brightness

;;

"ldn")

        echo 0 > /sys/devices/virtual/backlight/acpi_video0/brightness

;;

"l+")

        [ "$currentlevel" -lt "$maxbrightness" ] && let currentlevel++

        echo "$currentlevel" > /sys/devices/virtual/backlight/acpi_video0/brightness

;;

"l-")

        [ "$currentlevel" -gt "0" ] && let currentlevel--

        echo "$currentlevel" > /sys/devices/virtual/backlight/acpi_video0/brightness

;;

"setlight")

        if [ $# -gt "0" ]

        then

                [ "$1" -le "$maxbrightness" ] && echo "$1" > /sys/devices/virtual/backlight/acpi_video0/brightness

        else

        echo "Current brightness: $currentlevel"

        fi

;;

esac

```

Now if you put that in /usr/bin along with symlinks called lup, ldn, l+, l-.  Then these can be called by any other scripts you cre to write to set thigns automatically.

ldn sets minimum light

lup sets maximum light

l+ increases by one

l- decreases by one

setlight sets the light to a specified number - or if no argument is given simply echos the current light level.

You can allow normal user access safely by modifying the script to use sudo echo and placing the script in /usr/bin if you want also.

-Telemin-

----------

## Kvetch

thanks freestyling.

----------

