04-17-2013 08:11 PM
45 12
tools
  1. mmarz's Avatar
    I had been using an app called keylights to flash the black-light on my hardware keys when I had missed calls or texts. More info about that app here: KeyLights 0.2 - Capacitive Lights As Notification - Updated June 3, 2010. Here is a modified version I made with more options: KeylightsOV_signed.apk
    Unfortunately, that app refuses to install on some of the roms. Also, the app would only notify you of texts but not missed calls, missed voip calls, GV messages, Gtalk messages...etc.

    So I did some digging and figured out how to toggle the backlight myself. The attached script will turn the lights on for a split second second and then turn them off. If you open the script, you'll see that there really is nothing hard about implementing this. Combine this with Tasker and disabling the lights when you press the hardware keys, and you have yourself a dedicated notification light.

    Here is how to set this up to work on your phone with Tasker:

    1. Install tasker
    2. Install sl4a
    3. Download the Keylights.rar and extract it.
    4. Place userbackup.xml in /sdcard/tasker
    5. Place sush into /system/bin and change the permissions to "rwxr-xr-x"
      Code:
      adb remount
      adb push sush /system/bin/
      adb shell chmod 755 /system/bin/sush
    6. Place the four script files into /sdcard/sl4a/scripts
    7. Open tasker, hit the menu, profile data, restore
    8. Press apply to exit Tasker, and Go to Settings>Accessibility> Enable Accessibility for Tasker
    9. Reboot!


    As is, this will flash the button backlight LED's if you get a missed call, text, GV message, Gtalk message, or Groove IP missed call. If you want other notifications to trigger the lights, in Tasker hit New -> Event -> UI -> Notification -> Owner Application -> and select the app who's notifications you want to trigger the lights. When the Task Selection Menu pops up, select Togglekeylights.

    If you want to change the interval of flashing, edit the task of the Keylights profile. Change all the wait values. That profile is setup in that way to minimize the number of loops Tasker has to do.

    This mod stops the blacklight from turning on when you press the key. If you just want to do the same on your own without Tasker, run the following through adb shell or a script with root privileges:
    Code:
    chmod 0333 /sys/class/leds/button-backlight/brightness
    echo 0 > /sys/class/leds/button-backlight/brightness
    To reverse it:
    Code:
    chmod 0647 /sys/class/leds/button-backlight/brightness
    or just reboot. You'll need to run the disable command after every boot if you want the backlight to not turn on with a press of the keys. With the backlight disabled, you will still be able to flash it using the script provided. You are merely locking out the system from turning on the backlight. To implement this using tasker, delete all of the Tasker profiles except "Boot".

    If you do want your key backlight to function when you press the keys with this mod, delete the "Boot" profile, and reboot your phone.

    Also, I did this:
    http://forum.androidcentral.com/opti...optimus-v.html
    I think I voided my warranty

    With the flashing led script, disabling the led with key presses, and finally adding an external spot for the led, you'll have a fully functional and dedicated notification led.

    Bonus:
    After downloading the Keylights rar, replace the keylights.sh script with one of these for different flashing goodness. The built in keylights.sh is a single quick flash.
    Single slow flash
    Double quick flash
    Double slow flash
    Triple quick flash
    Special flash


    You could even create different flashing types for different notifications but it is up to you to figure that out.
    05-09-2011 07:49 AM
  2. Takenover83's Avatar
    Nice. I know I will giving this a shot mmarz. Thanks for the script and instructions.

    Edit: Any chance of you sharing your tasker profile data? (Menu>Profile Data>Backup). I am still learning the ropes, reading over the wiki.
    05-09-2011 11:41 AM
  3. mmarz's Avatar
    Here you go. You get my other profiles as a bonus. The ones that are necessary are:
    Screen-on
    Keylights
    Missed Text, GV, Call, VOIP, GT


    I hand edited the google talk profile to detect google talk notifications, so you may not want to change the trigger on that one.

    Also, you'll need sl4a to run the scripts for you. After you install it, put the two script files in the /sdcard/sl4a/scripts folder. The reason there are two scripts is that one toggle's the lights while the other one runs the toggle lights script as root since sl4a can't do it natively. And in order to make that little trickery work, you need to place the sush binary, that is also included, into your /system/bin folder and set the permissions to "rwxr-xr-x". In Tasker you select the script key-flash.sh, and that runs keylights.sh as root. Annoying but necessary.
    05-09-2011 01:40 PM
  4. vee's Avatar
    Is there a way to disable the button lights all together?

    Sent from my VM670 using Tapatalk
    05-09-2011 02:04 PM
  5. easyguy's Avatar
    Thanks, this is one of the feature I miss a lot from my blackberry with the flashing light alerts.
    05-09-2011 02:08 PM
  6. mmarz's Avatar
    Is there a way to disable the button lights all together?

    Sent from my VM670 using Tapatalk
    That would require a change at the rom/kernel level. When the buttons are pressed, that sends a notification to turn on the light. You need to disable that notification somehow.

    This feature itself would be a great addition to a rom, I think. It would require a lot of work, but if one of the rom devs were to take it on, I would have no choice but to use their rom exclusively and to curse all the other roms.

    Update: I was wrong. There is a way to disable them. Check the main post to see how.
    05-09-2011 02:49 PM
  7. anon(182107)'s Avatar
    Maybe somethings wrong with my backlight. My button lights are almost never visable. Is it normal for the button lights to be very dim?

    Sent from my Optimus V using Tapatalk
    05-09-2011 02:50 PM
  8. mmarz's Avatar
    In strong light, it is hard to see them. At night, they are clearly visible. I've considered opening up the phone and replacing the led with a brighter one...but that requires more time than I have.
    05-09-2011 03:15 PM
  9. vee's Avatar
    That would require a change at the rom/kernel level. When the buttons are pressed, that sends a notification to turn on the light. You need to disable that notification somehow.

    This feature itself would be a great addition to a rom, I think. It would require a lot of work, but if one of the rom devs were to take it on, I would have no choice but to use their rom exclusively and to curse all the other roms.
    Yep same here. Can't tell you how many times I wait the 5 seconds for the lights to turn off to continue using the page. Bit OCDish.

    Gj on script btw

    Sent from my VM670 using Tapatalk
    05-09-2011 04:03 PM
  10. Takenover83's Avatar
    Tested the script. It works fine. I copied it to "/system/bin" as I knew that was in my path. I also made sure it was executable. Now I just need to get it working in tasker.

    Any other Tasker options I should be mindful of? Your GV Tasker profile, is that for Google Voice SMS?
    05-09-2011 04:25 PM
  11. mmarz's Avatar
    Tested the script. It works fine. I copied it to "/system/bin" as I knew that was in my path. I also made sure it was executable. Now I just need to get it working in tasker.

    Any other Tasker options I should be mindful of? Your GV Tasker profile, is that for Google Voice SMS?
    Yes it is for Google Voice SMS.

    I wish there were more options but Tasker is the only kid on the block that can do all the tasks we want. You'd need to develop your own app otherwise.
    05-09-2011 06:21 PM
  12. Takenover83's Avatar
    mmarz, where is the script supposed to be? tasker keeps throwing me a error telling me it can't find it.
    05-09-2011 06:25 PM
  13. mmarz's Avatar
    You place the scripts in this folder: /sdcard/sl4a/scripts/

    Then when you are in tasker selecting the script, you press the search button all the scripts in that folder pop up as options.

    Have you installed sl4a yet?
    05-09-2011 06:31 PM
  14. mmarz's Avatar
    Also, I had some free time on my lunch break, so I did this:



    Details and a step by step to come later, but I did this the old school MacGyver way. All you need is an eyeglass repair kit, a drill, and some tape.
    05-09-2011 06:33 PM
  15. Takenover83's Avatar
    I had not. Just googled it and installed. The only thing I have done is the following

    Install tasker
    Load your backup for tasker
    install sl4a
    Put scripts in the correct folder (sdcard/sl4a/scripts/)
    chmod them (not sure if I had to that)

    I have been sending test messages to my google voice. I am still trying to get my mind around tasker. It's very in-depth/daunting...

    Edit: Nice mod.I wonder if you could get it to the right of the Virgin Mobile logo?
    05-09-2011 06:53 PM
  16. mmarz's Avatar

    Edit: Nice mod.I wonder if you could get it to the right of the Virgin Mobile logo?
    You can, there are three LED' that make up the back light for the keys. They are located in between the keys. I picked that one because it was the easiest to do, but you could do one in the center or on the right.
    05-09-2011 07:20 PM
  17. vee's Avatar
    Also, I had some free time on my lunch break, so I did this:



    Details and a step by step to come later, but I did this the old school MacGyver way. All you need is an eyeglass repair kit, a drill, and some tape.
    Bet you could sell this mod on Craigslist.

    Sent from my VM670 using Tapatalk
    05-09-2011 07:41 PM
  18. mmarz's Avatar
    Bet you could sell this mod on Craigslist.

    Sent from my VM670 using Tapatalk
    But where is the fun in that? It would also not be worth my time. After I put out the directions, almost anyone will be able to do it with minimal effort. I don't understand why LG didn't think this was necessary.
    05-09-2011 08:11 PM
  19. Takenover83's Avatar
    Notification light would of been nice. Armv7 cpu or above would of been better. So many cools games/apps I can not purchase because they are armv7. But I am getting off topic.

    Edit #1: Do we need screen-on.sh and screen-off.sh?
    Edit #2: Just re-read post #3. Did not place the binary...
    Edit #3: I got it work, yay! Placed the binary, chmod'ed it, opened sl4a and ran the script once to grant sl4a superuser permissions.
    Edit #4: Keeps flashing unless I enable screen-on & screen-off. But if those are enabled, I get a error saying those do not exist, as they were not included. But the flashing does stop.
    05-09-2011 08:16 PM
  20. mmarz's Avatar
    Notification light would of been nice. Armv7 cpu or above would of been better. So many cools games/apps I can not purchase because they are armv7. But I am getting off topic.

    Edit #1: Do we need screen-on.sh and screen-off.sh?
    Edit #2: Just re-read post #3. Did not place the binary...
    Edit #3: I got it work, yay! Placed the binary, chmod'ed it, opened sl4a and ran the script once to grant sl4a superuser permissions.
    Edit #4: Keeps flashing unless I enable screen-on & screen-off. But if those are enabled, I get a error saying those do not exist, as they were not included. But the flashing does stop.
    I exported all of my Tasker profiles. That included portions that had nothing to do with the notification hack. You don't need the screen off profile or the boot profile. For the screen on profile, you can edit the task and remove the part that runs screen-on.sh. That is my firewall profile.

    Here is how the setup works.

    Flashing lights:
    The Keylights profile is waiting for the variable "KEYLIGHTS" to be set to "Go". When that happens, it will run the keylights script and then set the variable "KEYLIGHTS" to "Go2". Because the variable has changed, the Keylights profile will end. That cases the exit task to be performed. The exit task waits 10 seconds, and then sets "KEYLIGHTS" to "Go" again. This causes the Keylights profile to be triggered again. And this loops forever unless interrupted. (you can edit the 10 seconds to any value you want)

    Triggering the flashing lights:
    Then we setup profiles for different types of notifications. We'll use the SMS one as an example. When you get an SMS, the profile is activated and that causes the variable "KEYLIGHTS" to be set to "Go". That act causes the Keylights profile to be activated since it is waiting for "KEYLIGHTS" to be set to "Go".

    Ending the flashing lights:
    The last profile is the screen-on profile. This is triggered whenever you turn on the screen. When that happens, the task will set "KEYLIGHTS" to "Off". Since "KEYLIGHTS" is set to off, the Keylights profile will no longer work, and so if it is looping to flash the lights, it will stop.


    And to make all of this work correctly, I've added some "if" conditions. Like the script will only flash if the screen is already off. The triggers also only work if the screen is off.
    asadullah likes this.
    05-09-2011 09:14 PM
  21. Takenover83's Avatar
    Thanks. I edited the screen-on profile and disabled the screen-off profile. That got me fixed up. Not the most noob friendly solution but it is a very good solution and much better then keylights0.2.apk
    05-10-2011 12:10 AM
  22. mmarz's Avatar
    Is there a way to disable the button lights all together?

    Sent from my VM670 using Tapatalk
    I was wrong when I first answered your question. Check the main post for a method to do just that.
    05-10-2011 12:49 AM
  23. mmarz's Avatar
    Thanks. I edited the screen-on profile and disabled the screen-off profile. That got me fixed up. Not the most noob friendly solution but it is a very good solution and much better then keylights0.2.apk
    Awesome! I'm not the only weirdo doing this stuff!

    Once you get familiar with tasker you can do some complicated stuff. You are pretty much writing your own apps on the fly.
    05-10-2011 12:51 AM
  24. csrow's Avatar
    Do you notice any impact on the battery usage?
    05-10-2011 04:55 AM
  25. vee's Avatar
    I was wrong when I first answered your question. Check the main post for a method to do just that.
    That's it? I'll try the adb commands when I get home later today. If they really do stay disabled, i'll be really happy, I personally see no use for them on my end.
    05-10-2011 07:08 AM
45 12
LINK TO POST COPIED TO CLIPBOARD