Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,879 Members 43,528 Now Online
XDA Developers Android and Mobile Development Forum

[Script] Darkness in the dark hours

Tip us?
 
Adolf1994
Old
(Last edited by Adolf1994; 24th January 2012 at 08:22 PM.)
#1  
Adolf1994's Avatar
Senior Member - OP
Thanks Meter 66
Posts: 384
Join Date: Jun 2010
Location: Fertőrákos
Default [Script] Darkness in the dark hours

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
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier

Am I the only one here with animated avatar?
The Following 8 Users Say Thank You to Adolf1994 For This Useful Post: [ Click to Expand ]
 
diimaan
Old
#2  
diimaan's Avatar
Senior Member
Thanks Meter 80
Posts: 443
Join Date: Oct 2007
can I use script manager to run this at boot?
A True Indian Traveler...

LG G2, Galaxy S, Xperia X10i, N900, K850i, K790i, N73, N90, 6670, 6610, 6210
 
Adolf1994
Old
#3  
Adolf1994's Avatar
Senior Member - OP
Thanks Meter 66
Posts: 384
Join Date: Jun 2010
Location: Fertőrákos
I think it'd be fine
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier

Am I the only one here with animated avatar?
 
shahkam
Old
#4  
shahkam's Avatar
Senior Member
Thanks Meter 482
Posts: 4,820
Join Date: Jan 2011
Location: Canada
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?
 
shahkam
Old
#5  
shahkam's Avatar
Senior Member
Thanks Meter 482
Posts: 4,820
Join Date: Jan 2011
Location: Canada
Quote:
Originally Posted by shahkam View Post
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?
 
Adolf1994
Old
#6  
Adolf1994's Avatar
Senior Member - OP
Thanks Meter 66
Posts: 384
Join Date: Jun 2010
Location: Fertőrákos
Quote:
Originally Posted by shahkam View Post
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.
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier

Am I the only one here with animated avatar?
 
Zer0_
Old
#7  
Zer0_'s Avatar
Senior Member
Thanks Meter 139
Posts: 742
Join Date: Jun 2010
Location: Toronto
Sorry for being a noob, but what does this do? :$
---------------------------
Phone Information
Current Device: Samsung Galaxy S 4 (SGH-I337M)
Build: Danvdh-GE-4.4.4-07172014
Android Version: 4.4.4 KK
Provider: Koodo
Previous Device: Samsung Galaxy S III I9300 (SGH-I747M)

---------------------------
 
AyDee
Old
#8  
AyDee's Avatar
Senior Member
Thanks Meter 845
Posts: 1,256
Join Date: Sep 2010
Location: Mobile

 
DONATE TO ME
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
 
Adolf1994
Old
#9  
Adolf1994's Avatar
Senior Member - OP
Thanks Meter 66
Posts: 384
Join Date: Jun 2010
Location: Fertőrákos
Quote:
Originally Posted by AyDee View Post
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
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier

Am I the only one here with animated avatar?
 
shahkam
Old
#10  
shahkam's Avatar
Senior Member
Thanks Meter 482
Posts: 4,820
Join Date: Jan 2011
Location: Canada
Adolf any clue why it didnt work.for me and i kept having stderr thingy

Sent from my X10i using XDA Premium App


ROM: FrostyICS - june 4 2012
Build: T999VVLALH2
Kernel: Stock
Device: Galaxy S3

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

Advanced Search
Display Modes


Get Better Debug Data with Crash Report SDK

Developing an application is a hard and often times ungratifying task. It also requires quite a … more

Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more

Android App Review: Hide Your Files with Androignito – XDA Developer TV

Stop right now, look at your phone, and see how many pictures, … more