[Script] Darkness in the dark hours

Search This thread

Adolf1994

Senior Member
Jun 2, 2010
411
65
Fertőrákos
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 :p)
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:D
(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?id=com.haxor&feature=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://xdaforums.com/showpost.php?p=17514012&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:

shahkam

Senior Member
Jan 22, 2011
5,002
472
31
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?
 

Adolf1994

Senior Member
Jun 2, 2010
411
65
Fertőrákos
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.
 

AyDee

Senior Member
Sep 30, 2010
1,258
945
Mobile
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
 

shahkam

Senior Member
Jan 22, 2011
5,002
472
31
Canada
Adolf any clue why it didnt work.for me and i kept having stderr thingy

Sent from my X10i using XDA Premium App
 

shahkam

Senior Member
Jan 22, 2011
5,002
472
31
Canada
Huh? I think i wasnt clear i used your script and when i ran it whit gscript i got twice stderr message twice one under the other like this
Stderr
Stderr any clue why?

Sent from my X10i using XDA Premium App
 

Adolf1994

Senior Member
Jun 2, 2010
411
65
Fertőrákos
Huh? I think i wasnt clear i used your script and when i ran it whit gscript i got twice stderr message twice one under the other like this
Stderr
Stderr any clue why?

Sent from my X10i using XDA Premium App

for this script only gscript gives empty stderrs. if I run it with a terminal emulator/adb there's no stderr.
it's a problem of gscript
 

diimaan

Senior Member
Oct 9, 2007
588
122
thinkingparticle.com
@Adolf or @My_Immortal
any new experiments with sd card mounting?

There was some interesting posts by one shaun in link2sd thread! he's using x10! somehow he managed to find more free space in /system than in /data!

so no need of an extra partition, you can just run the script to mount the /system as rw on boot and then link the link2sd mount point to it! I sent a PM to him about how is it working! let's see...
 

shahkam

Senior Member
Jan 22, 2011
5,002
472
31
Canada
Ohhh but i tried terminal too pasted the script and nothing happened? o_O

Sent from my X10i using XDA Premium App
 

baz@gmx.co.uk

Senior Member
Dec 2, 2010
657
124
I use this script most nights now, thanks Adulf! perhaps a mod to the script could be to set an expiry time value? (or is this not possible!)
 

iridaki

Retired Forum Moderator
Feb 21, 2007
4,532
5,190
37
Edinburgh, Scotland
@Adolf or @My_Immortal
any new experiments with sd card mounting?

There was some interesting posts by one shaun in link2sd thread! he's using x10! somehow he managed to find more free space in /system than in /data!

so no need of an extra partition, you can just run the script to mount the /system as rw on boot and then link the link2sd mount point to it! I sent a PM to him about how is it working! let's see...

There are currently 190 MB free in my system partition, 219 MB in data and 11 GB in my sdcard, so I really want to use Links2SD on an ext partition in my SD, rather than anywhere else! ;)
But it's nice that there's progress!!
 

diimaan

Senior Member
Oct 9, 2007
588
122
thinkingparticle.com
There are currently 190 MB free in my system partition, 219 MB in data and 11 GB in my sdcard, so I really want to use Links2SD on an ext partition in my SD, rather than anywhere else! ;)
But it's nice that there's progress!!

190 mb? that's far less you should clean up some junk in your system then! :p

btw this is the msg I got from shaun! you can check how it works!

http://xdaforums.com/show...&postcount=834

Should explain how to do it, just need to add commands to a start up script that is editable on your phone, that runs before the GUI is started. Dunno how I would create a universal script as you will need to edit diff files on diff phones.

If there is anything you don't understand from my post I'll try and help.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    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 :p)
    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:D
    (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?id=com.haxor&feature=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://xdaforums.com/showpost.php?p=17514012&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 ;)
    2
    I just thought people might still be interested in this, so have a bump.
    1
    Just run the script again and wait till the LEDs light up.
    Ooops, another thing I should've added to first post:eek: