Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
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: 382
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


I just like the show

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 79
Posts: 423
Join Date: Oct 2007
can I use script manager to run this at boot?
 
Adolf1994
Old
#3  
Adolf1994's Avatar
Senior Member - OP
Thanks Meter 66
Posts: 382
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


I just like the show

Am I the only one here with animated avatar?
 
shahkam
Old
#4  
shahkam's Avatar
Senior Member
Thanks Meter 432
Posts: 4,504
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 432
Posts: 4,504
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: 382
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


I just like the show

Am I the only one here with animated avatar?
 
Zer0_
Old
#7  
Zer0_'s Avatar
Senior Member
Thanks Meter 109
Posts: 699
Join Date: Jun 2010
Location: Under your bed
Sorry for being a noob, but what does this do? :$
---------------------------
Phone Information
Current Device: Samsung Galaxy S 4 (SGH-I337M)
Build: Stock (Rooted)
Android Version: 4.2.2
Provider: Koodo
Previous Device: Samsung Galaxy S III I9300 (SGH-I747M)

---------------------------
 
AyDee
Old
#8  
AyDee's Avatar
Senior Member
Thanks Meter 214
Posts: 718
Join Date: Sep 2010

 
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: 382
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


I just like the show

Am I the only one here with animated avatar?
 
shahkam
Old
#10  
shahkam's Avatar
Senior Member
Thanks Meter 432
Posts: 4,504
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

 
Post Reply+
Tags
cool, dark, darkness, hours
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Go to top of page...

XDA PORTAL POSTS

Tasker Alternative: AutomateIt, Automates Your Device Tasks – XDA Developer TV

XDA Developer TV Producer Kevin wants to help make your … more

Preventing App Piracy: Join the Discussion

The topic of piracy is always a touchy subject, but I feel that the grass roots style of Android … more

Jolla Sailfish OS Flagship Device Makes First Appearance

Given the amount of coverage that Android receives around here, you could almost be … more

XDA University: Porting ClockworkMod Recovery to New Devices

Having a good recovery makes the process of modifying, tweaking, maintaining, … more