One of the Sony Vaio Z-series and Linux has found a way to have the brightness control working both on the nvidia and intel graphics configurations. The solution is reported in the mailing list:
https://lists.launchpad.net/sony-vaio-z-series/msg00315.html
Excerpted below:
> 1) Make the file /etc/acpi/events/sony-brightness-up with the contents:
>
> event=sony/hotkey SNC 00000001 40000011
> action=/usr/local/bin/vaioz-brightness up
>
> 2) Make the file /etc/acpi/events/sony-brightness-down with the contents:
>
> event=sony/hotkey SNC 00000001 40000010
> 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 (( $LEVEL>7 )); then LEVEL=7; fi
> if (( $LEVEL<0 )); 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
Updated counts:
https://lists.launchpad.net/sony-vaio-z-series/msg00315.html
Excerpted below:
> 1) Make the file /etc/acpi/events/sony-brightness-up with the contents:
>
> event=sony/hotkey SNC 00000001 40000011
> action=/usr/local/bin/vaioz-brightness up
>
> 2) Make the file /etc/acpi/events/sony-brightness-down with the contents:
>
> event=sony/hotkey SNC 00000001 40000010
> 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 (( $LEVEL>7 )); then LEVEL=7; fi
> if (( $LEVEL<0 )); 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
Updated counts:
- Sony Vaio Z-series and Linux -- 112 active memberships
- Dell Latitude E4200/E4300 and Linux -- 35 active memberships
- Lenovo ThinkPad X301 and Linux -- 24 active memberships
- Toshiba Portege R500-R600 and Linux -- 10 active memberships
- Samsung X360 and Linux -- 8 active memberships
- Acer Aspire Timeline 3810T and Linux -- 8 active memberships
No comments:
Post a Comment