Thread: Keyboard Light
View Single Post
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#14
Sorrrrrry - had a bit to drink last night... using a keyboard was not a sane idea!

The backlight under the keyboard is provided via 6 indepedent lights. Control and status information for those lights are found in /sys/class/leds/lp5523:kb*
oslo:~# ls -l /sys/class/leds/lp5523:kb1/
-rw-r--r-- 1 root root 4096 Dec 20 02:34 brightness
lrwxrwxrwx 1 root root 0 Dec 20 02:21 device -> ../../i2c-adapter/i2c-2/2-0032
-rw-rw-rw- 1 root root 4096 Dec 20 02:22 led_current
drwxr-xr-x 2 root root 0 Dec 20 02:21 power
lrwxrwxrwx 1 root root 0 Dec 20 02:21 subsystem -> ../../leds
-rw-r--r-- 1 root root 4096 Dec 20 02:21 trigger
-rw-r--r-- 1 root root 4096 Dec 20 02:21 uevent
The following loop sequentially sets the brightness of each of the 6 lights located under the keyboard to 255 (i.e. on) and then back to 0 (i.e. off). If you do it in the dark, you should see the position of each light.

backlights.sh
Code:
#! /bin/sh

for i in 1 2 3 4 5 6 ; do
    echo 255 > /sys/class/leds/lp5523:kb${i}/brightness ;
    sleep 1 ;
    echo   0 > /sys/class/leds/lp5523:kb${i}/brightness ;
done

Tadaaaaaaaaaaaaa
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -