Friday, December 24, 2010

Disable HTC Hero Track Ball LED [Requires Root]

The HTC Hero cellphone is a Google Android phone. I found the trackball LED to be rather irritating in dim lighting due to its excessive brightness and general lack of purpose. I like the track ball but I do not need it to be lit up to use it. It seemed silly to waste the extra battery power on this LED so I set out to disable it. After some digging and probing through the phone's OS I found what I was looking for.

The LED's are located here:
 /sys/class/leds/
Prerequisites, you will need your phone rooted and will need a terminal to work. I recommend using the Android SDK to connect to the phone so you can type on a full size keyboard.

To turn the trackball LED on and off simply do the following:
on:
echo 1 > /sys/class/leds/vtkey-backlight/brightness
off:
echo 0 > /sys/class/leds/vtkey-backlight/brightness
To disable the led do the following:
echo 0 > /sys/class/leds/vtkey-backlight/brightness
chmod -w /sys/class/leds/vtkey-backlight/brightness
This removes write privileges to the LED, effectively locking it in an off state. To undo:
chmod +w /sys/class/leds/vtkey-backlight/brightness
Currently this effect seems to be undone with a reboot of the phone. I'll look into making it permanent eventually.

0 comments: