Subversion Repositories oBacklight

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/branches/oBacklight 0.3.x/changelog.txt
0,0 → 1,58
2012-04-13 Marcus Uddenhed <marcus@osource.se>
* oBacklight (core): Added new brightness mode settings.
2011-03-28 Marcus Uddenhed <marcus@osource.se>
* oBacklight (core): Fixed duplicate options for BMT variable.
 
* oBacklight (core): Added more ACPI code templates.
 
2011-03-22 Marcus Uddenhed <marcus@osource.se>
* oBacklight (core): Added the possibillity to use predefined settings.
 
* oBacklight (core): Added some predefined settings.
 
* oBacklight (core): Added ACPI events for Dell Vostro 3700
 
* readme.txt (text): Minor changes in readme.txt
 
2010-07-06 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight (core): Fixed bug resulting in random brightness changes.
 
2010-07-05 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight (startup): Added so that max brightness value gets inserted into nvidia_bl driver configuration since it starts on max anyway.
 
2010-07-04 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight (core): Added a control to prevent brightness changes generating out of range values. Thanks again to damdim at nvnews.com forum for spotting this issue.
 
2010-07-03 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight (core): Changed static values for max brightness, increase & decrease to variables to enable easier modification and system adaptation. thanks to damdim at nvnews.com forum for this input.
 
2010-07-02 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight (init): Fixed faulty LSB header information.
 
2010-06-29 Marcus Uddenhed <marcus@osource.se>
 
* oBacklight.sh (file): Removed .sh file ending for startup script conformance.
 
* oBacklight (core): Rewritten entire core to use ACPI calls instead of folder monitoring.
 
* changelog.txt (text): Fixed faulty changelog format & missing changes from 2010-06-15.
 
* readme.txt (text): Minor text changes.
 
2010-06-15 Marcus Uddenhed <marcus@osource.se>
 
* readme.txt (text): Added contact information.
 
* license.txt (file): Added License file.
 
2010-05-01 Marcus Uddenhed <marcus@osource.se>
 
* readme.txt (file): Created.
 
* oBacklight.sh (file): Created.
/branches/oBacklight 0.3.x/license.txt
0,0 → 1,20
Copyright (c) 2010, oSource Development
 
All rights reserved.
 
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
 
* Neither the name of the oSource Development nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/branches/oBacklight 0.3.x/oBacklight
0,0 → 1,192
#!/bin/bash
 
#####################################################################
# Simple script to catch the changes to backlight events on sony #
# in combination with nvidiabl. #
# #
# Tested with a Sony Vaio VPCCW1S1E Laptop. #
# #
# This has been tested on openSUSE 11.2, 11.3 & 11.4 and #
# Ubuntu 11.10 but should work on any distributions. #
# #
# Released under the BSDL Licens #
# #
# Developer: oSource Development #
# DevTeam: Marcus Uddenhed #
# Version: 0.3.9 #
# #
# Web: http://dev.osource.se/software/obacklight/ #
# Rss: http://dev.osource.se/category/obacklight/feed/ #
# #
# Last Updated: 2012-04-13 20:08 #
# #
#####################################################################
 
### BEGIN INIT INFO
# Provides: oBacklight
# Required-Start: $acpid
# Required-Stop:
# Default-Start: 5
# Default-Stop: 0 1 2 3 6
# Short-Description: Provides a backlight event handler for nvidiabl
# Description: Captures all backlight events from ACPI Events and feeds them to nvidiabl.
### END INIT INFO
 
init() {
## Default parameters
BMT="1" # Set Brightness Mode Types.
# Available types: 1, 2, 3, 4
 
ACPIS="1" # Set correct System ACPI codes.
# Available settings: 1, 2, 3
 
## Various brightness modes
# Mode 1 (Default)
if [ "$BMT" == "1" ]
then
BBL="2" # Default brightness level when on battery.
DID="1" # The amount of steps to increase/decrease with on backlight changes.
MBV="7" # Max brightness value possible on your system.
fi
# Mode 2
if [ "$BMT" == "2" ]
then
BBL="40"
DID="10"
MBV="127"
fi
# Mode 3
if [ "$BMT" == "3" ]
then
BBL="4"
DID="1"
MBV="32"
fi
# Mode 4
# Tested on a VPCCW15FL, thanks to Esteban
if [ "$BMT" == "4" ]
then
BBL="40"
DID="17"
MBV="120"
fi
 
## ACPI Codes for various systems.
 
# ACPIS 1(Default)
# Works on some Sony Vaio VPCCW1S1E
if [ "$ACPIS" == "1" ]
then
ACBU="00000001 00000011" # ACPI brightness up event
ACBD="00000001 00000010" # ACPI brightness down event
ACOB="00000081 00000000" # ACPI brightness on battery event
fi
# ACPIS 2
# Works on some Sony Vaio VPCCW1S1E
if [ "$ACPIS" == "2" ]
then
ACBU="00000086 00000000"
ACBD="00000087 00000000"
ACOB="00000081 00000000"
fi
# ACPIS 3
# Works on Dell Vostro 3700
if [ "$ACPIS" == "3" ]
then
ACBU="00000086 00000000"
ACBD="00000087 00000000"
ACOB="00000080 00000000"
fi
 
# Set correct values in configuration files on startup
echo "$MBV" > /sys/class/backlight/nvidia_backlight/brightness
echo "$MBV" > /root/oBacklight.def
 
# Check if oBacklight.def exists
if [ ! -e "/root/oBacklight.def" ]
then
echo "$MBV" > /root/oBacklight.def
fi
}
 
start() {
 
/etc/init.d/oBacklight run &
 
}
 
stop() {
 
echo $(cat /sys/class/backlight/nvidia_backlight/brightness) > /root/oBacklight.def
killall -r oBacklight
 
}
 
run() {
while [ exit != 130 ]
do
 
GVAR=$(cat /sys/class/backlight/nvidia_backlight/brightness)
 
CMD=$(acpi_listen -c 1 | egrep -o " [0-9].+" | egrep -o "[0-9].+")
 
# Brightness down acpi event
if [ "$CMD" == "$ACBD" ]
then
 
if [ "$GVAR" -ge "$DID" ] # Thanks to damdim @ nvnews forum for this fix.
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" == "$ACBU" ]
then
if [ "$GVAR" -le $(($MBV-$DID)) ] # Thanks to damdim @ nvnews forum for this fix.
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
 
# AC to battery change
if [ "$CMD" == "$ACOB" ]
then
if [ "$GVAR" > "$BBL" ]
then
echo $BBL > /sys/class/backlight/nvidia_backlight/brightness
echo $BBL > /root/oBacklight.def
fi
fi
 
done
}
 
case $1 in
start)
start
;;
stop)
stop
;;
run)
init
run
;;
*)
echo "start|stop|run"
;;
esac
/branches/oBacklight 0.3.x/readme.txt
0,0 → 1,25
Release notes for oBacklight v0.3.9 2012-04-13
==============================================
 
Overview:
Simple script to catch the changes to backlight events on laptops in combination with
the nvidiabl found here: http://www.nvnews.net/vbulletin/showthread.php?t=143025
 
Purpose:
Provide bridge between nvidiabl and FN brightness keys.
 
Issue Summary:
* Fixed duplicate options for BMT variable
* Added more ACPI code templates.
 
Notes:
This script has been tested on openSUSE 11.2, 11.3 & 11.4 and Ubuntu 11.10
but should work on any distribution and with Sony Vaio VPCCW1S1E Laptop.
 
Disclaimer:
This software is released with the BSDL license and the license is in the license.txt
file that should accompany this software.
 
Contact:
http://dev.osource.se/
http://dev.osource.se/software/obacklight/