Go Back   Android Forums > Android Phones > LG Connect 4G > Connect 4G - All Things Root

Like Tree1Likes

test: Reply
 
LinkBack Thread Tools
Old June 7th, 2012, 10:49 PM   #1 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default [MOD][SCRIPT] Enable/Disable soft key LEDS *6/14/12*

I'm sure your tired of those soft key lights on in your face when your trying to watch a movie or read right? Well so am I! So i decided to write a script to disable and enable them with the click of a widget. cool right?

Prerequisites:
Root
SManager
Your Phone

  1. First install the app above and accept the SU request.
  2. Use a root file browser and move the script from the SD Card your system/etc/init.d folder
  3. Go into SManager and locate the 2 scripts. Click on them and tap the little star button in the top left to make them a favorite. And click the little SU icon while your at it!
  4. Add the widget to your home screen, run the script and turn off the display and then turn it back on.
  5. Enjoy a light free phone


Scipts:
Toggle LEDS.zip

Thanks:
Dracconus
V SuperUser V
MotoTriumphant likes this.

Advertisements
KrazeeCracker is offline  
Last edited by KrazeeCracker; June 14th, 2012 at 09:08 PM.
Reply With Quote
The Following 13 Users Say Thank You to KrazeeCracker For This Useful Post:
Dracconus (June 7th, 2012), DroidFan83 (June 8th, 2012), julio65873 (September 27th, 2012), LightenLhar (June 8th, 2012), madman0wns (April 9th, 2013), Master4697 (June 10th, 2012), Mexjoker (June 8th, 2012), MotoTriumphant (June 14th, 2012), Pappy62 (October 30th, 2012), schemppjr80 (July 29th, 2012), V SuperUser V (June 9th, 2012), VeNoMzRevenge (June 11th, 2012), Ære (June 8th, 2012)
sponsored links
Old June 7th, 2012, 11:35 PM   #2 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

I'm going to take a look at this, and make a modified version just for learning experience if it's cool with you. I'll upload it when I'm done, but I'm keeping what it is a secret 'till I'm done 'cuz I don't wanna have someone else code it first, and/or make empty promises :P

BTW, upload them as one file on that host because they make you wait 4 mins in between small dl's like that...kinda ridiculous.
__________________
If you would like to donate please use the link below.
Donate to me here
Dracconus is offline  
Reply With Quote
Old June 7th, 2012, 11:45 PM   #3 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Ill reupload tomorrow lol.

And go for it haha the more we learn, the more we can accomplish with this phone!
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 12:02 AM   #4 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
Ill reupload tomorrow lol.

And go for it haha the more we learn, the more we can accomplish with this phone!
I'm gonna up it on a website I don't really use for anything anymore, if that's cool with you. Will have it zipped so that people can just extract it on their phones.
QR Code, and link will be up shortly if you're kewl with it.
Dracconus is offline  
Reply With Quote
The Following User Says Thank You to Dracconus For This Useful Post:
KrazeeCracker (June 8th, 2012)
Old June 8th, 2012, 12:16 AM   #5 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Well, apparently 000webhost is having problems (as usual) so I just decided to dropbox it for now.

Link: SoftKey Switch Scripts as .zip (Both)
-----------------------------
QR Code (Barcode for Barcode Scanning App on Phone)
Hit "Show" below this text





Dracconus is offline  
Reply With Quote
The Following 2 Users Say Thank You to Dracconus For This Useful Post:
LightenLhar (June 8th, 2012), Master4697 (June 10th, 2012)
Old June 8th, 2012, 08:45 AM   #6 (permalink)
I'm Not Real, Doris!
 
Mexjoker's Avatar
 
Join Date: Aug 2011
Location: Atlanta, Georgia
Gender: Male
Posts: 3,078
 
Device(s): LG Esteem(#2 v2.8.1)
Carrier: MetroPCS

Thanks: 593
Thanked 1,009 Times in 683 Posts
Default

One question. Do you think this could work on the esteem? :b Just curios.
Mexjoker is offline  
Reply With Quote
Old June 8th, 2012, 10:13 AM   #7 (permalink)
Senior Member
 
airtioteclint's Avatar
 
Join Date: Dec 2011
Posts: 1,909
 
Device(s): Galaxy S4, Galaxy Note 10.1, Galaxy S3, LG Connect, LG Esteem, Motorola Droid X, BlackBerry Tour
Carrier: MetroPCS, T-Mobile

Thanks: 615
Thanked 854 Times in 617 Posts
Default

nice work bro. i think if you can find a way combine the two to turn on and off you can sell it in the market for some good change.
airtioteclint is offline  
Reply With Quote
Old June 8th, 2012, 10:50 AM   #8 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by Mexjoker View Post
One question. Do you think this could work on the esteem? :b Just curios.
Its possible lol, if you can let me know where the LED brightness for the buttons is located I can help.
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 02:14 PM   #9 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: Key Largo
Gender: Male
Posts: 96
 
Device(s): Samsung Galaxy S3
Carrier: MetroPCS

Thanks: 9
Thanked 8 Times in 7 Posts
Default

I would like to suggest an addition to the instructions that you need to turn your screen off and back on again in order for it to take effect. Other than that note this is utterly brilliant and it definitely makes it much easier on the eyes when I'm reading a book or something on my phone
LightenLhar is offline  
Reply With Quote
Old June 8th, 2012, 02:50 PM   #10 (permalink)
I'm Not Real, Doris!
 
Mexjoker's Avatar
 
Join Date: Aug 2011
Location: Atlanta, Georgia
Gender: Male
Posts: 3,078
 
Device(s): LG Esteem(#2 v2.8.1)
Carrier: MetroPCS

Thanks: 593
Thanked 1,009 Times in 683 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
Its possible lol, if you can let me know where the LED brightness for the buttons is located I can help.
Where do i find that?
Mexjoker is offline  
Reply With Quote
sponsored links
Old June 8th, 2012, 03:27 PM   #11 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by Mexjoker View Post
Where do i find that?
Honestly without having the esteem in my hands idk, if you want to PM me and setup a time where you can install teamviewer on your phone i can go through and look for you thatd be fine with me.

The connect is located in sys/class/leds/button backlight.
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 03:55 PM   #12 (permalink)
I'm Not Real, Doris!
 
Mexjoker's Avatar
 
Join Date: Aug 2011
Location: Atlanta, Georgia
Gender: Male
Posts: 3,078
 
Device(s): LG Esteem(#2 v2.8.1)
Carrier: MetroPCS

Thanks: 593
Thanked 1,009 Times in 683 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
Honestly without having the esteem in my hands idk, if you want to PM me and setup a time where you can install teamviewer on your phone i can go through and look for you thatd be fine with me.

The connect is located in sys/class/leds/button backlight.
Same location. I found the leds folder
Mexjoker is offline  
Reply With Quote
Old June 8th, 2012, 04:10 PM   #13 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by Mexjoker View Post
Same location. I found the leds folder
Odds are of will work for you, but before you try it what's the Max brightness inside that folder set to?
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 04:32 PM   #14 (permalink)
I'm Not Real, Doris!
 
Mexjoker's Avatar
 
Join Date: Aug 2011
Location: Atlanta, Georgia
Gender: Male
Posts: 3,078
 
Device(s): LG Esteem(#2 v2.8.1)
Carrier: MetroPCS

Thanks: 593
Thanked 1,009 Times in 683 Posts
Default

15
Mexjoker is offline  
Reply With Quote
Old June 8th, 2012, 04:45 PM   #15 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by Mexjoker View Post
15
Yep my script will work bro!
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 09:27 PM   #16 (permalink)
Senior Member
 
MotoTriumphant's Avatar
 
Join Date: May 2012
Posts: 655
 
Device(s): Rooted Lg Optimus V, Rooted Motorola Triumph, Rooted LG Connect, Rooted Lg Motion(current)
Carrier: Not Provided

Thanks: 300
Thanked 53 Times in 34 Posts
Default

so... after I install the script do I extract it? what do I do with the script? where do I put it? thx guys (;
MotoTriumphant is offline  
Reply With Quote
Old June 8th, 2012, 10:56 PM   #17 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by MotoTriumphant View Post
so... after I install the script do I extract it? what do I do with the script? where do I put it? thx guys (;
Extract it and move it to your SD card. Then with a root explorer move it to your system/etc/init.d folder. Then follow the reatbof the guide in my first post lol. Goodluck! Ill answer any questions/problems you have!
KrazeeCracker is offline  
Reply With Quote
Old June 8th, 2012, 11:14 PM   #18 (permalink)
I'm Not Real, Doris!
 
Mexjoker's Avatar
 
Join Date: Aug 2011
Location: Atlanta, Georgia
Gender: Male
Posts: 3,078
 
Device(s): LG Esteem(#2 v2.8.1)
Carrier: MetroPCS

Thanks: 593
Thanked 1,009 Times in 683 Posts
Default


Got this error
Mexjoker is offline  
Reply With Quote
Old June 9th, 2012, 02:25 AM   #19 (permalink)
Junior Member
 
Join Date: Apr 2012
Location: Key Largo
Gender: Male
Posts: 96
 
Device(s): Samsung Galaxy S3
Carrier: MetroPCS

Thanks: 9
Thanked 8 Times in 7 Posts
Default

It's normal, just shut your screen off and back on and the led's turn off/on anyway.
LightenLhar is offline  
Reply With Quote
Old June 9th, 2012, 03:14 AM   #20 (permalink)
Senior Member
 
MotoTriumphant's Avatar
 
Join Date: May 2012
Posts: 655
 
Device(s): Rooted Lg Optimus V, Rooted Motorola Triumph, Rooted LG Connect, Rooted Lg Motion(current)
Carrier: Not Provided

Thanks: 300
Thanked 53 Times in 34 Posts
Default

I went to system/etc/ I cant find the init.d folder, does it say "init.d folder" because I cant find it sorry for being a noob guys.
MotoTriumphant is offline  
Last edited by MotoTriumphant; June 9th, 2012 at 03:44 AM.
Reply With Quote
sponsored links
Old June 9th, 2012, 08:00 AM   #21 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by Mexjoker View Post

Got this error
Haven't found a work around for that error yet. But it still works lol
KrazeeCracker is offline  
Reply With Quote
Old June 10th, 2012, 01:06 AM   #22 (permalink)
Senior Member
 
MotoTriumphant's Avatar
 
Join Date: May 2012
Posts: 655
 
Device(s): Rooted Lg Optimus V, Rooted Motorola Triumph, Rooted LG Connect, Rooted Lg Motion(current)
Carrier: Not Provided

Thanks: 300
Thanked 53 Times in 34 Posts
Default

bump (my last post on here)
MotoTriumphant is offline  
Reply With Quote
Old June 10th, 2012, 01:11 AM   #23 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by MotoTriumphant View Post
bump (my last post on here)
Give me a moment, I'm going to look through something for you, I'll respond in a bit.
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 01:21 AM   #24 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

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.
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 01:26 AM   #25 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Okay, I just tried that, and I'm getting the chmod 444 execution error /system/etc.init.d/lightso on not found....five me a bit, and I'll figure it out hopefully.
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 01:35 AM   #26 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by MotoTriumphant View Post
bump (my last post on here)
Okay, here's what you need to do if Init.d is missing.

1. Go through the steps in the main post, download script manager, install it, give it SU permissions.
2. use root explorer to go into system/etc and CREATE the init.d folder (IMPORTANT) it needs to be in LOWER CASE
3. Browse back to the SD card, and move the two scripts to the folder you just created, then go through the sequential steps in the main post to finish installation.

Remember, even though you'll get the chmod 444 error lock the screen, and it'll work.

Please hit the "thanks" button if I helped.
Dracconus is offline  
Reply With Quote
The Following 2 Users Say Thank You to Dracconus For This Useful Post:
MotoTriumphant (June 10th, 2012), schemppjr80 (July 29th, 2012)
Old June 10th, 2012, 08:38 AM   #27 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Inside

sys/class/leds/button-backlight

Find "max_brightness"
Using root explorer or any other file manager that allows you to change permissions long press on it and check the 'write' permission for the owner. And the script should work now even after getting the error message. To turn the light back on after using the script on just lock and unlock your phone.

This permissions however will revert after a reboot is completed



EDIT: Scratch the above,
-Open the scripts provided by the OP with a text editor using root explorer
-Everywhere you see "max_brightness" (is only in there twice in ea script) change it to "brightness" (in other words, delete "max_")
-Now, save and exit
-Do this for both on and off scripts
-Problem solved, everything should work even after a reboot
-Whats happening here is 'brightness' has a rw permission by default

edit: found out its only a temporary lights out fix, the lights come back on within a few seconds
__________________
Modder/Themer
I will teach you as i learn.....so thank me now because you will thank me later anyway
Be a NEW GUY not a N00B, check this before posting: LG Esteem All Things Root Guide
V SuperUser V is offline  
Last edited by V SuperUser V; June 10th, 2012 at 09:31 AM.
Reply With Quote
Old June 10th, 2012, 02:09 PM   #28 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Here is the fix . put this inside the off script and inside the on script, the only thing you have to change inside the on script is the 'echo 0' to 'echo 15'

Then save and exit

#!/system/bin/sh
busybox mount ,rw /sys/class/leds/button-backlight/max_brightness
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
V SuperUser V is offline  
Last edited by V SuperUser V; June 10th, 2012 at 03:39 PM.
Reply With Quote
Old June 10th, 2012, 03:46 PM   #29 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
Here is the fix . put this inside the off script and inside the on script, the only thing you have to change inside the on script is the 'echo 0' to 'echo 15'

Then save and exit

#!/system/bin/sh
busybox mount ,rw /sys/class/leds/button-backlight/max_brightness
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
This is good for the lights off. But what about lights on? Change the 0 to a 15? Ill be updating the OP tonight with new links.
KrazeeCracker is offline  
Reply With Quote
Old June 10th, 2012, 04:12 PM   #30 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
This is good for the lights off. But what about lights on? Change the 0 to a 15? Ill be updating the OP tonight with new links.
Exactly and yw
V SuperUser V is offline  
Reply With Quote
sponsored links
Old June 10th, 2012, 04:42 PM   #31 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by porquepine View Post
Ok, so the dilemma is, do you call T-mobile and let them know you got the goods and have not been charged so you can get the G3 Service, or do you not say anything for awhile, let the dust settle and then you call to just pay for the service because you bought it elsewhere??? wow, the possibilities...LOL
Thanks I appreciate it bro! I just haven't had the time to look into it lol. Next we need to look into changing the colors!
KrazeeCracker is offline  
Reply With Quote
Old June 10th, 2012, 05:11 PM   #32 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Cleaned up the code:


#!/system/bin/sh
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 06:55 PM   #33 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

A small script modified to turn the red charging light off who some may find anoying

http://db.tt/g1LUB0Pg

To turn it back on either unplug and plug the phone back on the charger or reboot.
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 06:57 PM   #34 (permalink)
Member
Thread Author (OP)
 
KrazeeCracker's Avatar
 
Join Date: May 2011
Location: Florida
Posts: 467
 
Device(s): SGS2TMOB - CM9, HTC One X - Stock, Galaxy Nexus 7 - Stock
Carrier: Not Provided

Thanks: 202
Thanked 90 Times in 45 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
A small script modified to turn the red charging light off who some may find anoying

http://db.tt/g1LUB0Pg

To turn it back on either unplug and plug the phone back on the charger or reboot.
Permission to add this to OP with proper credit? Lol
KrazeeCracker is offline  
Reply With Quote
Old June 10th, 2012, 07:36 PM   #35 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Testing a toggle method now, may take a bit, but I think I've got it.
Dracconus is offline  
Last edited by Dracconus; June 10th, 2012 at 07:43 PM.
Reply With Quote
Old June 10th, 2012, 07:54 PM   #36 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Okay, I'm missing a 'then' as a condition for line 10 but I don't see how. I'm tired as crap, so someone help me fix this :P

#!/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
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 08:03 PM   #37 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
Permission to add this to OP with proper credit? Lol
YES lol
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 08:05 PM   #38 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by KrazeeCracker View Post
Permission to add this to OP with proper credit? Lol
Use this one though, with OFF and ON scripts

http://db.tt/2QEfFsnt
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 08:35 PM   #39 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

LOL FUUUUUCK I'm stupid

#!/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

It's fixed. This toggles it

You're welcome
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 08:56 PM   #40 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by Dracconus View Post
LOL FUUUUUCK I'm stupid

#!/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

It's fixed. This toggles it

You're welcome
didnt work for me
V SuperUser V is offline  
Reply With Quote
sponsored links
Old June 10th, 2012, 09:10 PM   #41 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
didnt work for me
it didn't let you use a single script to perform both off and on function?

You still have to lock the screen in-between them, and re-run to toggle from off to on.

What aspect didn't work? Does it print any errors?
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 09:17 PM   #42 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

I just tested it...works absolutely fine on the Broken Out ROM.
Maybe you need to chmod on the stock, but I don't see why you would.

Created an entirely new file, and input it by hand, saved it, and named it something completely different with a new widget, and it's working so I'm not sure what to tell ya...

Make sure you're using the one in the comment saying "FUUUUCK I'm stupid." because I removed the unnecessary semicolon that was closing the argument prematurely in it - thus making it work...on my phone at least.
Dracconus is offline  
Reply With Quote
The Following User Says Thank You to Dracconus For This Useful Post:
johnlime46 (June 13th, 2012)
Old June 10th, 2012, 09:18 PM   #43 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by Dracconus View Post
it didn't let you use a single script to perform both off and on function?

You still have to lock the screen in-between them, and re-run to toggle from off to on.

What aspect didn't work? Does it print any errors?
[: not found
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 10:08 PM   #44 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
[: not found
give me the exact words it gives you and i can help. General not found tells me nothing.
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 10:19 PM   #45 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Thats exactly what it says "[: not found", as it doesnt find "[" w/o the quotations
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 10:27 PM   #46 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
Thats exactly what it says "[: not found", as it doesnt find "[" w/o the quotations
Thought you means [: as if to be a smiley face...

As for "[:" not being found there is no colon in in the code at all, so that may be why if that's what it's saying.

Also, there's a chance that for some reason the script software you're using is detecting whitespace, which it shouldn't, so that being the case try this...

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
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 11:00 PM   #47 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

Quote:
Originally Posted by Dracconus View Post
Thought you means [: as if to be a smiley face...

As for "[:" not being found there is no colon in in the code at all, so that may be why if that's what it's saying.

Also, there's a chance that for some reason the script software you're using is detecting whitespace, which it shouldn't, so that being the case try this...

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
the colon belongs to the message itself, the SManager's message.

i will give the new code a try

edit: i dont know about coding but, are you supposed to declare values, etc? like:

#!/bin/sh
# This shell script is PUBLIC DOMAIN. You may do whatever you want with it.

TOGGLE=$HOME/.toggle

if [ ! -e $TOGGLE ]; then
touch $TOGGLE
command1
else
rm $TOGGLE
command2
fi
V SuperUser V is offline  
Last edited by V SuperUser V; June 10th, 2012 at 11:02 PM.
Reply With Quote
Old June 10th, 2012, 11:08 PM   #48 (permalink)
Senior Member
 
V SuperUser V's Avatar
 
Join Date: Mar 2012
Posts: 818
 
Device(s):
Carrier: Not Provided

Thanks: 234
Thanked 340 Times in 160 Posts
Default

[ -e not found, if i replace the [ with a { it jumps and says ] not found
V SuperUser V is offline  
Reply With Quote
Old June 10th, 2012, 11:30 PM   #49 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

Quote:
Originally Posted by V SuperUser V View Post
[ -e not found, if i replace the [ with a { it jumps and says ] not found
I'm going to record my screen and show you everything that needs to get done here since I'm starting to think that your error is PEBKAC...
Also, as we're both learning our way through linux shell apparently I suggest you take a gander at
Linux Shell Scripting Tutorial - A Beginner's handbook

also, try (and I HIGHLY doubt that removing the flag is going to work) remove the -e and the space before the "/" so remove "-e " in line three and see if that will fix it.
Dracconus is offline  
Reply With Quote
Old June 10th, 2012, 11:32 PM   #50 (permalink)
Member
 
Join Date: May 2012
Location: Dallas, Tx
Posts: 467
 
Device(s): Ascend@800Mhz, 2-Admire@900Mhz, LG Connect@1.8Ghz, Galaxy Tab 2@1.3Ghz, Transformer Prime@1.7Ghz
Carrier: Not Provided

Thanks: 13
Thanked 113 Times in 65 Posts
Default

and although this is common sense, make sure you're running as system R/O
Dracconus is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Phones > LG Connect 4G > Connect 4G - All Things Root
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:11 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.