Subversion Repositories oBacklight

Compare Revisions

No changes between revisions

Regard whitespace Rev 1 → Rev 2

/tags/oBacklight 0.3.6/oBacklight_0.3.6.tar.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/oBacklight 0.3.6/src/changelog.txt
0,0 → 1,41
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.
/tags/oBacklight 0.3.6/src/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.
/tags/oBacklight 0.3.6/src/oBacklight
0,0 → 1,142
#!/bin/bash
 
#####################################################################
# Simple script to catch the changes to backlight events on sony #
# in combination with nvidia_bl. #
# #
# Tested with a Sony Vaio VPCCW1S1E Laptop. #
# #
# This has been tested on openSUSE 11.2 & 11.3 but should #
# work on any distributions. #
# #
# Released under the BSDL Licens #
# #
# Developer: oSource Development #
# DevTeam: Marcus Uddenhed #
# Version: 0.3.6 #
# #
# Web: http://dev.osource.se/software/obacklight/ #
# Rss: http://dev.osource.se/category/obacklight/feed/ #
# #
# Last Updated: 2010-07-06 00:06 #
# #
#####################################################################
 
### 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 nvidia_bl
# Description: Provides a backlight event handler for nvidia_bl.
# Captures all backlight events from ACPI Events and feeds the to nvidia_bl.
### END INIT INFO
 
init() {
# Default parameters
BBL="2" # Default brightness level when on battery.
SCB="sony" # Set which system ACPI is used.
# Run 'sudo ls /sys/class/backlight' to determine your type.
# Available options: sony
DID="1" # The amount of steps to increase/decrease with on backlight changes.
MBV="7" # Max brightness value possible on your system.
 
# 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() {
if [ "$SCB" = "sony" ]
then
 
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" == "00000001 00000010" ]
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" == "00000001 00000011" ]
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" == "00000081 00000000" ]
then
if [ "$GVAR" > "$BBL" ]
then
echo $BBL > /sys/class/backlight/nvidia_backlight/brightness
echo $BBL > /root/oBacklight.def
fi
fi
 
done
 
fi
 
}
 
case $1 in
start)
start
;;
stop)
stop
;;
run)
init
run
;;
*)
echo "start|stop|run"
;;
esac
/tags/oBacklight 0.3.6/src/readme.txt
0,0 → 1,22
Release notes for oBacklight v0.3.6 2010-07-06
==============================================
 
Overview:
Simple script to catch the changes to backlight events on laptops in combination with
the nvidia_bl found here: http://www.nvnews.net/vbulletin/showthread.php?t=143025
 
Purpose:
Provide bridge between nvidia_bl and FN brightness keys.
 
Issue Summary:
* Fixed bug resulting in random brightness changes.
 
Notes:
This script has been tested on openSUSE 11.2 & 11.3 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/