typo / i'm visually challenged (my eyesight is terrible!) - no offence love the darkness script so thanks again adolf4661
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)
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. choose Add a script and name it whatever you want(e.g. NOLed) and paste these lines in it( you WILL get stderrs on 2.2+, but it's normal)
see note below
Note: if you get EMPTY stderrs, that's no problem. BUT if something is shown next to the stderr, like permission denied, then please reportCode:#! /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 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 /sbin/noled_tmp_reverse.prop ]; then chmod 00644 $LED1 chmod 00644 $LED2 chmod 00644 $LED3 chmod 00644 $LED4 rm /sbin/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 > /sbin/noled_tmp_reverse.prop fi exit
or grab the sh file here: https://mydisk.se/adolf1994/webpage/NOLed.sh
3. run the script and enjoy surfing at night without the annoying hw leds
optional. install Screen filter from market: https://market.android.com/details?id=com.haxor&feature=search_result
Q: Sooo, what the hell is this exactly?
A: This pack will switch off the hw leds and set the screen's brightness to a low value, so you can enjoy using your phone at night.
hope you like it
and don't forget to press thanks button
Your script requires
Reboot
adding at the end took me a while to make it work out,
or for others run script and reboot device enjoy
reboot is not needed
only if sbin is read-only(stock kernel)
but as soon as I have some spare time, I'll make it better
echo "\n\n# Darkness by Adolf1994\nDIR=$(cd /sys && find | grep brightness | cut -c 3- | cut -d : -f 1 | head -n 1)\nLED=/sys/$DIR\nLED1=$LED:rgb1:red/brightness\nLED2=$LED:rgb1:green/brightness\nLED3=$LED:rgb1:blue/brightness\nLED4=$LED:sled/brightness\necho 0 > $LED1\necho 0 > $LED2\necho 0 > $LED3\necho 0 > $LED4\nchmod 00444 $LED1\nchmod 00444 $LED2\nchmod 00444 $LED3\nchmod 00444 $LED4" >> /system/etc/hw_config.sh
@CAYCE_VII, not a single one. At a first glance it looks like you didn't tick SU permission for script.also please try out the one that disables at startup. It will append some lines to the end of /etc/hw_config.sh and those are required to be removed manually.
But if you did, it could be something with how the init script in ramdisk mounts partitions. Latter case requires DoomLord's opinion. And
BTW, I'm still on 2.1, so any further modification will just be a shoot into the dark
EDIT: I slightly modified the first post to make it - hopefully - final.
for now, just let me know if the startup one works. You can remove it later.
And your case is why I modified slightly my first post.
But before you do anything, tell me please, did you give superuser permission for my script? As the comment part of it says it needs that, too.
I see, but you know, it's better to prepare for the worst
Walk through the steps in the updated first post. If you challange any issues, just let me know.
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 /sbin/noled_tmp_reverse.prop ]; then
chmod 00644 $LED1
chmod 00644 $LED2
chmod 00644 $LED3
chmod 00644 $LED4
rm /sbin/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 > /sbin/noled_tmp_reverse.prop
fi
exit
Just run the script again and wait till the LEDs light up.
Ooops, another thing I should've added to first post
echo "\n\n\nrm /data/noled_tmp_reverse.prop" >> /system/etc/hw_config.sh
I just thought people might still be interested in this, so have a bump.
echo "\n\n\nrm /data/noled_tmp_reverse.prop" >> /system/etc/hw_config.sh
#! /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