Simple ConfigButton Plugin for toggling the keyboard light on and off.

An example for building a keyboard light with two LEDs mounted on the screen 
is given here:
http://boards.openpandora.org/index.php/page/articles.html/_/community-articles/tutorials/hmc-hardware-hack-1-keyboard-led-light-r63

Board posting version with embedded pictures:
http://boards.openpandora.org/index.php/topic/11741-hmc-hardware-hack-1-keyboard-led-light/?hl=%2Bhardware+%2Bhack



=== INSTALLATION ===

Copy the files 

kblight.so
light_bulb_off_48.png
light_bulb_on_48.png

to /usr/share/configbutton, then restart the /usr/bin/configbutton process 
or restart the Pandora.

Copy script 
op_kbd_light.sh
to /usr/pandora/scripts/
and make sure that it's executable.

Add this script to the sudoers file using the command:
sudo nano /etc/sudoers.d/50_openpandora

by adding the line:
%wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_kbd_light.sh

=== Other system modifications ===


For proper keyboard light handling, when
- Open / close lid:
- Switch unit on / off (standby) 

/usr/pandora/scripts/op_power.sh function display_off(): (at the beginning!) 
add line:
/usr/pandora/scripts/op_kbd_light.sh off
		
/usr/pandora/scripts/op_power.sh function display_on(): (at the beginning!)
add line
/usr/pandora/scripts/op_kbd_light.sh on


=== Additional information ===

If you need to detect (e.g. in another script), if the keyboard light is on 
or off:

Call the script op_kbd_light.sh without a parater. 
It will return the current status of the keyboard light in clear text 
on stdout and as an integer return value (0 .. 255).


=== Adjusting the brightness ===

You may adjust the brightness of the light, which defaults to maximum 
brightness, by creating the file
/etc/pandora/conf/keyboard_light_brightness
and putting a value between 1 and 255 in there.
255 is the default value (brightest), 1 is the lowest brightness. 
E.g. use 128 for half of the default brightness.

Note that I have experienced interference of the LED light pulsing 
with the WiFi signal: Whenever the LED brigntness is set to a value 
between (including) 1 and 254 and the LEDs are switched on, WiFi does 
not work properly anymore. However, with the brightness set to full 
255, there is no effect on WiFi.

2014-01-14 by Daniel Hertrich, http://www.hermocom.com
