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

Root [MOD][SCRIPT] Enable/Disable soft key LEDS *6/14/12*

ALternatively, try this first...
Change the first line from:
Code:
#!/system/bin/sh
to
Code:
#!/system/bin/bash
COULD work (not entirely sure, but it's worth a shot.)


dude i fixed it!!!!!!!!!!!!!!!

it was as simple as:

#!/system/bin/sh
if busybox [ -e /sys/blah blah blah

the "busybox" made all the difference before the bracket lmao
 
Upvote 0
say, do me a favor.


Try this:
Code:
#!/system/bin/sh
set -x
if [ -e /sys/class/leds/button-backlight/max_brightness ]; then
if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
echo 15 > sys/class/leds/button-backlight/max_brightness
else
echo 0 > sys/class/leds/button-backlight/max_brightness
fi
fi
and let me know everything it outputs.
Finally had some time to sit down, i tryed both and im getting a syntax error, "fi" expecting "then"
 
Upvote 0
Finally had some time to sit down, i tryed both and im getting a syntax error, "fi" expecting "then"

That one's for debugging.

This is the one you need, and if they get the "[ not found" issue the resolve is the second one.

Code:
#!/system/bin/sh
if [ -e /sys/class/leds/button-backlight/max_brightness ];
then
if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
echo 15 > sys/class/leds/button-backlight/max_brightness
else
echo 0 > sys/class/leds/button-backlight/max_brightness
fi
fi

Second

Code:
#!/system/bin/sh
if busybox [ -e /sys/class/leds/button-backlight/max_brightness ];
then
if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
echo 15 > sys/class/leds/button-backlight/max_brightness
else
echo 0 > sys/class/leds/button-backlight/max_brightness
fi
fi
[/end]
 
Upvote 0
It COULD, but I don't see any reason as to why it should.
Try using this, and let me know what happens...

Code:
#!/system/bin/sh
if [ -e /sys/class/leds/button-backlight/max_brightness ]; then
if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
busybox echo 15 > sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
else
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
fi
fi

WOW...I'm not helpful at ALL when I'm tired >.<
The entire thing we didn't notice, was that we left out the "busybox" before the brackets ^_^

@Krazee - This is the one with the working busybox =- not the one I posted before, sorry..

Code:
#!/system/bin/sh
if busybox [ -e /sys/class/leds/button-backlight/max_brightness ]; then
if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
busybox echo 15 > sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
else
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
fi
fi
 
Upvote 0
#!/system/bin/sh

if busybox [ -e /sys/class/leds/red/max_brightness ]; then

if busybox [ `cat /sys/class/leds/red/max_brightness` -eq 0 ]

then

busybox chmod 755 /sys/class/leds/red/max_brightness
echo 20 > sys/class/leds/red/max_brightness

echo " "

echo " ***********************"

echo " * CHARGING LIGHT ON *"

echo " * *"

echo " * ENJOY *"

echo " ***********************"

else

busybox chmod 755 /sys/class/leds/red/max_brightness
echo 0 > sys/class/leds/red/max_brightness

echo " "

echo " ************************"

echo " * CHARGING LIGHT OFF *"

echo " * *"

echo " * ENJOY *"

echo " ************************"
fi
fi

I'm using the same script for the charging light on the esteem but it get "fi" expecting "then", and if I change it to then it tells me it expects fi wtf?
 
Upvote 0
Nvm, fixed it. Went back and copy the working codes for the soft keys and replaced the path

Didn't even see that you had an issue; sorry. Was up all night doing some final testing, and setup on the stripper app.
Today, and tonight I'm going to build it's counterpart (the stock apps installer) and then I'm going to get to work on ZV8. (Unfortunately it's easier for me to do it in that order, since I'll need the installer for the stock unrooted versions of zv8, 9, and A.

Glad you got it working bro!
 
Upvote 0
Didn't even see that you had an issue; sorry. Was up all night doing some final testing, and setup on the stripper app.
Today, and tonight I'm going to build it's counterpart (the stock apps installer) and then I'm going to get to work on ZV8. (Unfortunately it's easier for me to do it in that order, since I'll need the installer for the stock unrooted versions of zv8, 9, and A.

Glad you got it working bro!

I'm reading about making an app for the Esteem to toggle these, mind sharing some tips? easy to use programs/tools?
 
Upvote 0
I'm reading about making an app for the Esteem to toggle these, mind sharing some tips? easy to use programs/tools?

an app to toggle what? The widgets?

Ehhh...don't really have a lot to go on there. I haven't dug into my androbox of knowledge quite yet. I'm going to delve into all that after I finish the ROM thread because I really need to get to work on a customers website that I've been putting off to get that done with.

Once I'm done with his site I'll start twerking around in the androbox and see what I can determine. Sorry I wasn't of more help on that one.
 
Upvote 0
Mine doesn't have init.d either, and I'm on stock zv9. I'm rebooting after isntalling script manager to see if it pops up, and if not, I'm going to manually create that folder, then try runnning the script and see what happens. Just give me a bit, and I'll post back with more details, and results. Sorry for the wait.

It work for me by just extracting it in SD then running the script, I didn't move it or make any folder. Is that normal?
 
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