• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [GUIDE/MOD]*UPDATED* 6/14/12. Softkeys LED light TOGGLE

V SuperUser V

Android Expert
Mar 29, 2012
817
339
The Usual.......I'm not responsible for what you do to your phone, I test these MODs on my phone and they work. If yours ends up broken, bricked, softbricked, etc, it is all on you (although we have an A-Team around all the time to help you get it back up and running :D)
I found this MOD over at the LG Connect section:
http://androidforums.com/connect-4g...-mod-script-enable-disable-soft-key-leds.html

and wanted to try it out since anything that helps save some battery is made for me.

So, if you feel you should THANK me for sort of porting this over to the ESTEEM, do so, but please drop by his Thread and THANK him too (IMPORTANT)

I had to take his scripts apart and modify them a little since the rw permission for the max_brightness would reset upon reboot. This googled Post gave me a general idea on how to overcome this issue: [DROIDX][BETA] - Releases - RootzWiki - Page 161
This Guide will show you how to turn off and on your LED lights under the soft keys and other small MODs

RULE#1 MAKE A FULL BACK UP. NO EXCUSES!!!



1-Download SManager (and SMWidgets):


Install it and allow it in SU.​

(you can use the script runner of your choice; this app gives you the ability to add widgets to the homescreen and better yet shortcuts.​


2-Download the script(s):

And using a file manager of you choice (Root Explorer in my case) unzip/extract and move the script(s) inside system/etc/init.d folder.​


3-SManager:

Open SManager and locate the script(s) (you might have to hit 'back' twice to get to the root of the phone, then go to system/etc/init.d folder) and click on each script; check the FAVORITE (star) and SU icons.​


5-Widgets/Shortcuts:

Now go to your home screen and add the SManager Widgets for the script(s). If you downloaded SMWidgets you may add shortcuts to the homescreen instead of battery draining widgets ;)


6-Enjoy more battery life!:thumb:​

Perhaps some steps i took or codes i used are not necessarily needed but keep in mind I'm still learning.


Known issues:

-SManager may force close when running the script (rare)

-You may need to run a script more than one time (twice) for it to take effect since permissions may need to be set


-In order to bring the softkey lights back on after toggling on you may need to lock then unlock the phone. The toggle script may have fixed this with just a small delay between the execution of the script and the lights actually coming on but it does not work all the time.
Tips and Tricks:


-Download the Softkeys lights off script, unzip it, move it inside system/etc/init.d and using SManager click on the 'Boot' option so the softkey lights will go OFF on boot (it may take a few seconds after booting back on for it to take effect but it does work)


Downloads:


1- SOFTKEYSSWITCH

2- GREEN LED SWITCH* (DONE)

3- BLUE LED SWITCH* (DONE)

4- RED/CHARGING LED SWITCH* (DONE)

5- Softkeys lights off

6- RED LED

7- BLUE and GREEN LED

8- FLASHLIGHT SWITCH

*BLUE and GREEN switches will disable the BLUE and GREEN LEDs, this means that if you receive an SMS/MMS/EMAIL or any other notification that uses this LEDs they will not light up to alert you that you have received one. To test it just send a message to yourself, exit out of the messaging app and lock your phone (otherwise if you stay in the messaging app with the screen on the LED will not come on after you receive the message and this is an android thing not related to the script)

*This one will toggle the charging light ON and OFF. After toggling it ON, you may need to unplug and/or plug you phone back to the charger for it to come back on.
Screenshots
ae8dd570-e880-ab03.jpg
ae8dd549-e89a-4412.jpg
Learners' Corner:


This is what the toggle scripts' codes look like:​



Code:
#!/system/bin/sh
Code:
[LEFT]if busybox [ -e /sys/class/leds/button-backlight/max_brightness ]; then[/LEFT]
 
[LEFT]if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]

then
[LEFT]busybox chmod 755 /sys/class/leds/button-backlight/max_brightness 
echo 15 > sys/class/leds/button-backlight/max_brightness
echo "                    "
echo "        *****************"
echo "        *  SOFTKEYS ON  *"
echo "        *               *" 
echo "        *     ENJOY     *"
echo "        *****************" 
else
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness 
echo 0 > sys/class/leds/button-backlight/max_brightness
echo "                    "
echo "        ******************"
echo "        *  SOFTKEYS OFF  *"
echo "        *                *" 
echo "        *      ENJOY     *"
echo "        ******************" 
fi
fi[/LEFT]
[/LEFT]
I will try to explain some of its sections because we all want to learn and not just flash and push stuff on and into our phones​





-'if', 'then', and 'else' are conditions used in conditional scripts like the one above. A simple way to understand it is that 'if' somethings meets a criteria, 'then' do something, else, do something else.​



-"if busybox [ -e /sys/class/leds/button-backlight/max_brightness ]; then

if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]"





'-e' means 'exist',

'-eq' means 'equal to'
'cat' is like the value inside the file at the end of the PATH​





so it translates to "if the file exists and the value inside the file is equal to 0 then do something​



-"busybox chmod 755 /sys/class/leds/button-backlight/max_brightness"



this one just says to set the permissions of the file max_brightness to 755 so we can modify it​



-"echo 15 > sys/class/leds/button-backlight/max_brightness"



'echo' will basically write '15' inside the last file/folder in the PATH; in this case is the 'max_brightness" file​



So in words we can all understand:​



If the file at the end of the PATH exists, then check the value inside of it and if it equals 0 then change it to 15 if not change it to 0 (or leave it the same in this case)​



Thanks to the already thanked users over at their Threads, Special thanks to Mexjoker who was trying this MOD from the Connect Thread and provided info regarding the rw permission not sticking. Thanks to everyone that find my GUIDES useful.
 
Thanks to the already thanked users over at their Threads, Special thanks to Mexjoker who was trying this MOD from the Connect Thread and provided info regarding the rw permission not sticking. Thanks to everyone that find my GUIDES useful.

I don't know what I did but welcome lol :p and I remember someone posting a thread about led notification but I forgot who it was lol. And your permissions guide on yiur post made it work on the esteem.
 
Upvote 0
Find a script to change the colors. That would be bad ass.

Nice work homie. ;)

The script can prolly be changed to turn the color LEDs on command, but implementing that into any sort of app to make them blink when an sms comes in is out of my league lol. There are apps for that, I know, but as I always say why have an extra app if I can do it myself ?!
 
Upvote 0
I haven't flashed this but I have a question? About a week ago my soft Keys were acting weird they would blink or turn off and then on and at the end all the lights turned off and now they don't lit up... Do you think if I use this to turn them back on would it work...

assuming you are not experiencing a hardware issue, you can try this and see if it helps :)
 
Upvote 0
Is it possible to make the leds flash? Like when you get a message or call?

i cant get those LEDs you're talking about (rgb) to turn on on command, the scripts can only disable and enable them sort of speak, meaning, you can disable the blue led so when you get an sms it doesnt light up, and enable it back on whenever you do want the led to notify you that you got an sms.
the script changes the value of max_brightness file inside /sys/class/leds/button-backlight

maybe another script can change the values back and forth automatically, but that means mms.apk for example will have to call for a different file instead of max_brightness when trying to notify you of an sms/mms, its confusing i know, i cant really explain it lol :D but there is an app for that in the market
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones