i had already tried declaring it, didnt help, it say it not found too. I'm running the script on the ESTEEM, dont know if that will make a huge difference since the script to turn off and on works just fine (after changing the chmod to 755)
#!/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
I think it may be something to do with the way that busybox integrates into the Esteem vs. the connect. Don't really know, but it's worth a shot to try everything I can think of
Only true way to learn is to fail right xD
right right,
tried that last one, gave me the [: not found
Thanks for all the help. Permissions are set to w on the max_brightness file itself, and im running the script while RO, so that I know shouldn't be messing up the script lol
what's this red light your guys are talking about?
4?! why so many? random and of topic but I can't wait for better stable roms out for the connect I see my self having this phone for a long time
oh I see. What were the temps looking like on your previous phones and what is the highest temp ur current reached?
Sure, not a problem at all...just pisses me off that I can't help you solve it. Never really been the type to just be "okay" with not figuring something out. I'm sure it's going to bug the utter **** out of me until someone figures it out if I don't just go buy an esteem and do so myself (which I wouldn't, money's too tight atm.)
i'm trying to learn how to script myself lol, but it seems harder when you know next to nothing.
I google, but i get no str8 answers
1- in the script, whats the word/character that opens 'max_brightness' via the string to check the value (15 or 0)? would it be that "-e" or can we use the wourd 'touch'? as in
if [ touch sys/class/leds/button-backlight/max_brightness == "0" ]; then
busybox blah blah blah......
or something similar?
2- my understanding of the script is that it goes and opens the file, checks the value and if it meets a set criteria it does something if not it does something else. I just want to understand how that translates into a script, broken down piece by piece
3- I've tried SManager to make the OFF script run on boot, but it doesnt seem to work, i guess because it runs to early and it works best if it ran after the media scan.
4- Instead of `cat, can you just use $whatever?
damn, this really took a liking lol. Maybe we can get this incorporated into a ROM! haha
#!/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
WOW, i wish i had half the knowledge you do! I mean i can only do some basic coding lol. Will have to reup script to OP!Not sure if you saw this, but I turned it into a toggle'able one so now you just need one widget on your homescreen. Tap for on, let script run, lock screen, do the same thing for off.
**NOTE** Apparently doesn't work on the esteem for some reason.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
WOW, i wish i had half the knowledge you do! I mean i can only do some basic coding lol. Will have to reup script to OP!
See you may have just started like me, but you have more past experience in the game lol. I appreciate how much you have helped as well as superuser!haha, thanks but I just started working with *NIX a few days ago. I'd have to say that a shell script is far from anything "pro" but it's definitely the same type of start I had when I got into WoW Server Emulation; and if that's to say anything about me if I get enough resources fast enough within the next six months I'm going to be coding ROM's by hand from source.
Was in the emulation scene for little under two years, and have people tell me all the time that they've seen my name somewhere, or my code. hell, I even have peopel that made NPC's on their servers named after me...LOL
It's kinda kewl to see people so dedicated to the ones that help them. Always feels good to know that knowledge is being put to use, yaknow.
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.