Comment 22 for bug 173652

Revision history for this message
jeannich (jeannich) wrote : Re: unable to adjust screen brightness on recent Sony Vaio notebooks

I have the same bug on my Sony Vaio-SZ95 laptop.
The default script "/etc/acpi/sonybright.sh" in Hardy beta does not seem to work.
You can try replacing it my workaround bellow (mainly inspired by "Matt"'s comment at "http://moelhave.dk/gnulinux-ubuntu-gutsy-gibbon-710-on-the-sony-vaio-sz6-series/") [Note that this script uses "/etc/acpi/var/brightness" file so, you have to create it]

#!/bin/bash
function adjust
{
   BRIGHTNESS=$1
   if [ $BRIGHTNESS -ge 9 ]; then
      BRIGHTNESS=9
   fi

   if [ $BRIGHTNESS -le -9 ]; then
      BRIGHTNESS=-9
   fi

   echo $BRIGHTNESS >/etc/acpi/var/brightness
   B=0.$BRIGHTNESS
   B=$(echo $B | sed -e {s/0.-/-0./})
   echo “adjusting brightness to $B”
   /usr/bin/nvidia-settings -c ":0.0" -V -a Brightness=$B 2>/tmp/sonybright.log
}

BRIGHTNESS=$(cat /etc/acpi/var/brightness)

if [ "x$1" = "xdown" ]; then
   BRIGHTNESS=$(( $BRIGHTNESS - 1 ))
   adjust $BRIGHTNESS
elif [ "x$1" = "xup" ]; then
   BRIGHTNESS=$(( $BRIGHTNESS + 1 ))
   adjust $BRIGHTNESS
else
   echo >&2 Unknown argument $1
fi