Get a Complete Set of Logs with Andy Log

The importance of proper logging is undeniable. No, we’re not talking about lumberjack work. … more

Try Some Android Lollipop Applications on Your Device

Android 5.0 Lollipop has been officially announced and lucky users of Google Nexus 5 … more

AutoCon Manages Your Connections to Perserve Battery Life

As we’ve talked about in the past, battery life is still somewhat of a sore … more

How to Unlock and Root a Nexus Device – XDA TV

It is official–Google has released the Nexus 6 and the Nexus 9. The Nexus family … more
Post Reply

[Script] Darkness in the dark hours

OP Adolf1994

10th April 2011, 12:57 PM   |  #1  
Adolf1994's Avatar
OP Senior Member
Flag Fertőrákos
Thanks Meter: 66
 
384 posts
Join Date:Joined: Jun 2010
More
hi everyone
I present to you:
Darkness in the dark hours

this is a pack of:
- a script I made
- Gscript lite
- Screen filter(optional, but recommended)

I strongly recommend to you to read the whole post and only then apply my script!

A lot of users tried to find a way to do this, so I polished my script I used for Eternity to make it universal(hopefully )
this script made to work with rooted 2.1+ firmwares and busybox properly installed.

1. Install Gscript lite
2. To make this script revertable on the newer brand of kernels, you will need to add one line to hw_config.sh (because I just don't trust init.d scripts)
run this from adb or any terminal emulator from phone as superuser
Code:
echo "\n\n\nrm /data/noled_tmp_reverse.prop" >> /system/etc/hw_config.sh
3. in Gscript choose Add a script and name it whatever you want(e.g. NOLed) and paste these lines in it
Code:
#! /system/bin/busybox sh
# "turn off keyboard and notification LEDs" for ANY android firmware
# this script needs su access
# made by Adolf1994
# thanks for the help diimaan
# maybe final version - revertable
# requires hw_config.sh modification to be properly revertable
DIR=$(cd /sys && find | grep brightness | cut -c 3- | cut -d : -f 1 | head -n 1)
LED=/sys/$DIR
LED1=$LED:rgb1:red/brightness
LED2=$LED:rgb1:green/brightness
LED3=$LED:rgb1:blue/brightness
LED4=$LED:sled/brightness
if [ -s /data/noled_tmp_reverse.prop ]; then
chmod 00644 $LED1
chmod 00644 $LED2
chmod 00644 $LED3
chmod 00644 $LED4
rm /data/noled_tmp_reverse.prop
else
echo 0 > $LED1
echo 0 > $LED2
echo 0 > $LED3
echo 0 > $LED4
chmod 00444 $LED1
chmod 00444 $LED2
chmod 00444 $LED3
chmod 00444 $LED4
echo 1 > /data/noled_tmp_reverse.prop
fi
exit
4. tap on "Needs SU" then save

5. run the script and enjoy surfing at night without the annoying hw leds
(most likely you WILL get stderrs on 2.2+, but it's normal)
Note: if you get EMPTY stderrs, that's no problem. BUT if something is shown next to the stderr, like permission denied, then please report

optional. install Screen filter from market: https://market.android.com/details?i...=search_result
This is only for 2.1 and/or 2.2. On 2.3 I experienced a problem that's I couldn't press install in package installer activity. I nearly reinstalled the whole thing. You've been warned!

Night is over? Just run the script again and wait till the LEDs light up.


If You Don't Like LEDs At All, This Pretty Line Will Disable Them At Startup
http://forum.xda-developers.com/show...2&postcount=27



Q: Why modifying hw_config.sh?
A: Because if you reboot your phone while the leds are off, there will remain a file that normally indicates how the script should act upon running it. That one particular file should not present after boot.

Q: I'm on Wolfbreak's ROM. Won't that mess tweaks up?
A: In no way. Impossible. Unless you didn't follow steps properly.


hope you like it
and don't forget to press thanks button
Last edited by Adolf1994; 24th January 2012 at 08:22 PM.
The Following 8 Users Say Thank You to Adolf1994 For This Useful Post: [ View ]
10th April 2011, 02:52 PM   |  #2  
diimaan's Avatar
Senior Member
Thanks Meter: 80
 
444 posts
Join Date:Joined: Oct 2007
can I use script manager to run this at boot?
10th April 2011, 03:00 PM   |  #3  
Adolf1994's Avatar
OP Senior Member
Flag Fertőrákos
Thanks Meter: 66
 
384 posts
Join Date:Joined: Jun 2010
More
I think it'd be fine
10th April 2011, 05:57 PM   |  #4  
shahkam's Avatar
Senior Member
Flag Canada
Thanks Meter: 484
 
4,840 posts
Join Date:Joined: Jan 2011
More
the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?
10th April 2011, 06:03 PM   |  #5  
shahkam's Avatar
Senior Member
Flag Canada
Thanks Meter: 484
 
4,840 posts
Join Date:Joined: Jan 2011
More
Quote:
Originally Posted by shahkam

the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?

i cant paste the text corectly ffs i think thats the problem can you upload the script as ".sh" so i can load it whit gscript?
10th April 2011, 06:04 PM   |  #6  
Adolf1994's Avatar
OP Senior Member
Flag Fertőrákos
Thanks Meter: 66
 
384 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by shahkam

the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?

from gscript I get a bunch of stderrs, too. however, from a terminal emulator it runs fine, so no problem.
It's the most noticeable if the phone is on the charger, because you will see that the led suddenly switches off.
you can revert the script back with a simple reboot.
10th April 2011, 06:46 PM   |  #7  
Zer0_'s Avatar
Senior Member
Flag Toronto
Thanks Meter: 140
 
744 posts
Join Date:Joined: Jun 2010
More
Sorry for being a noob, but what does this do? :$
10th April 2011, 07:44 PM   |  #8  
AyDee's Avatar
Senior Member
Flag Mobile
Thanks Meter: 910
 
1,256 posts
Join Date:Joined: Sep 2010
Donate to Me
More
It disables the l.e.d.s. It should be made a little clearer in op.

Is there a script to turn them back on?

Sent from my X10a using XDA App
10th April 2011, 08:13 PM   |  #9  
Adolf1994's Avatar
OP Senior Member
Flag Fertőrákos
Thanks Meter: 66
 
384 posts
Join Date:Joined: Jun 2010
More
Quote:
Originally Posted by AyDee

It disables the l.e.d.s. It should be made a little clearer in op.

Is there a script to turn them back on?

Sent from my X10a using XDA App

sorry if I wasn't clear. I'll fix it soon
and change it to revertable, too
11th April 2011, 01:46 AM   |  #10  
shahkam's Avatar
Senior Member
Flag Canada
Thanks Meter: 484
 
4,840 posts
Join Date:Joined: Jan 2011
More
Adolf any clue why it didnt work.for me and i kept having stderr thingy

Sent from my X10i using XDA Premium App

Post Reply Subscribe to Thread

Tags
cool, dark, darkness, hours
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes