[Sony-vaio-z-series] LCD backlight and nvidia

2009-06-12 Thread Romuald Janik
Dear All,

I managed to find a solution which works for both nvidia and intel
cards. I used some info from
http://ubuntuforums.org/showthread.php?t=784671 for acpi events (note
they are different for Z31) and a different script. Since this may be
useful for someone I include the setup below.

1) Make the file  /etc/acpi/events/sony-brightness-up with the contents:

event=sony/hotkey SNC 0001 4011
action=/usr/local/bin/vaioz-brightness up

2) Make the file  /etc/acpi/events/sony-brightness-down with the contents:

event=sony/hotkey SNC 0001 4010
action=/usr/local/bin/vaioz-brightness down

3) Make the script /usr/local/bin/vaioz-brightness

#!/bin/bash

lspci | grep 00:02.0 /dev/null
INTELQ=$?
if [ $INTELQ == 0 ]
then
LEVEL=$(cat /sys/class/backlight/acpi_video0/brightness)
else
LEVEL=$(cat /sys/class/backlight/sony/brightness)
fi

if [ $1 == 'up' ]; then let LEVEL+=1; fi
if [ $1 == 'down' ]; then let LEVEL-=1; fi
if (( $LEVEL7 )); then LEVEL=7; fi
if (( $LEVEL0 )); then LEVEL=0; fi

let LEVEL=16+$LEVEL*12

if [ $INTELQ == 0 ];
then
#intel
INTEL_LEVEL=$(( $LEVEL*255/100 ))
BRL=$(printf %02X $INTEL_LEVEL)
setpci -s 00:02.0 F4.B=$BRL
else
#nvidia
smartdimmer -s $LEVEL
fi

4) restart acpi system

sudo /etc/init.d/acpid restart

The event codes were obtained by running acpi_listen
Best wishes,
Romuald

___
Mailing list: https://launchpad.net/~sony-vaio-z-series
Post to : sony-vaio-z-series@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sony-vaio-z-series
More help   : https://help.launchpad.net/ListHelp


[Sony-vaio-z-series] LCD backlight and nvidia

2009-06-11 Thread Romuald Janik
Dear All,

I installed Ubuntu Jaunty (x64) on my new VAIO VGN-Z31XN. I installed
the sony-laptop-0.9 module and followed the tutorial posted here to
turn off either nvidia or intel.

When using intel, the Fn5 and Fn6 keys work well for decreasing and
increasing brightness.
When using nvidia, the keys bring up a notification slider for
brightness but changing its position does not do anything.

I also found that from the command line I can set the brightness level using
smartdimmer -s brightness level 15-100

Is there a way to hook this to the Fn5 and Fn6 keys when using nvidia?
All the best,
Romuald

___
Mailing list: https://launchpad.net/~sony-vaio-z-series
Post to : sony-vaio-z-series@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sony-vaio-z-series
More help   : https://help.launchpad.net/ListHelp