View Single Post
Old 07-04-10, 07:55 AM   #64
damdim
Registered User
 
Join Date: Jan 2010
Posts: 21
Default Re: Linux backlight driver

Nice changes Marcus. But there is another small problem I forgot to wright in my previous post. In the "Brightness down acpi event" you should add another "if statement" that checks if GVAR is less or equal to MBV-DID. The same goes for "Brightness up acpi event" that checks if GVAR is greater or equal to DID. f.e.

Code:
 # Brightness down acpi event
  if [ "$CMD" == "00000001 00000010" ]
   then
    if [ "$GVAR" -ge "$DID" ]
     then
      SVAR=$(($GVAR - $DID))
      echo $SVAR > /sys/class/backlight/nvidia_backlight/brightness
      echo $SVAR > /root/oBacklight.def
      else
      SVAR="0"
      echo $SVAR > /sys/class/backlight/nvidia_backlight/brightness
      echo $SVAR > /root/oBacklight.def
    fi
  fi

  # Brightness up acpi event
  if [ "$CMD" == "00000001 00000011" ]
   then
     if [ "$GVAR" -le $(($MBV-$DID)) ]
     then
      SVAR=$(($GVAR + $DID))
      echo $SVAR > /sys/class/backlight/nvidia_backlight/brightness
      echo $SVAR > /root/oBacklight.def
      else
      SVAR=$MBV
      echo $SVAR > /sys/class/backlight/nvidia_backlight/brightness
      echo $SVAR > /root/oBacklight.def
    fi
  fi
damdim is offline   Reply With Quote