Controlling LEDs from the Shell

From WebOS Internals
Revision as of 23:22, 20 July 2009 by Hopspitfire (talk | contribs) (New page: I wish the device would indicate via flashing LED that I had a message or alert waiting. I didn't find a way to do it via the regular interface, but from the command line I can at least c...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

I wish the device would indicate via flashing LED that I had a message or alert waiting. I didn't find a way to do it via the regular interface, but from the command line I can at least control the led via the sysfs mounted on /sys

The list of LEDs are:

root@castle:/sys/class/leds# ls -F
core_navi_center/  core_navi_left/    core_navi_right/   kbd_bl_led_center/ kbd_bl_led_left/   kbd_bl_led_right/

the core_navi_left is the left-bottom white led in the "gesture" area.

root@castle:/sys/class/leds/core_navi_left# ls -F
brightness  device@     power/      subsystem@  uevent

with the device sleeping and no panel leds on:

root@castle:/sys/class/leds/core_navi_left# cat brightness 
0

to make one of the LEDs light up

root@castle:/sys/class/leds/core_navi_left# echo 50 > brightness 

that set the intensity at about 50%. The only numeric values that made any visible change were in the range of 0-100. Setting it back to zero turned off the LED:

root@castle:/sys/class/leds/core_navi_left# echo 0 > brightness 

So if I want it bad enough, and nobody finds an easier way to do it in the app framework, I could probably write a shell script or some awful hack to manually twiddle the LEDs