Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: HOWTO: Led notifcation for new mail/messages/calls

  1. #1
    Join Date
    Aug 2005
    Beans
    20
    Distro
    Ubuntu 9.10 Karmic Koala

    Lightbulb HOWTO: Led notifcation for new mail/messages/calls

    Hi,

    Do you want to have one of your notebook/laptop LEDs light up when you got new mail, new instant messages or blink when there's an incoming call? Then this one is for you:

    1. Figure out what triggers your LED
    If detected properly, turning a LED on or off is as easy as writing 1 or 0 into a special file ("LED control file") that is being generated by the kernel, such as

    Code:
    /proc/acpi/asus/mled
    for ASUS laptops. Google for "your-laptop-model linux led" and search /proc/ for candidates. Test them with e.g.

    Code:
    echo 1 > /proc/acpi/asus/mled
    2. Get plugins/extensions for your programs

    1. Mozilla and Mozilla Thunderbird: http://moztraybiff.mozdev.org/ An extension for Mozilla and Mozilla Thunderbird to notify you about new mail, includes a tray icon. It detects many LEDs automatically, and if it fails to do for you, set the "mail.biff.hw_indicator_file" preference to match your LED control file.
    2. Pidgin: http://koti.mbnet.fi/simom/pidgin/led-notification/ A new message notification plugin with a GUI option to change the path to the LED control file.
    3. Other programs (such as e.g. skype): Some programs allow you to configure a script that is executed when an event such as in incoming call or a new message arrival occurs. You can then paste the following lines into a new file:
      Code:
      #!/bin/bash
      for ((i = 0; i < 6; i++)) do
         echo 1 > /proc/acpi/asus/mled;
         sleep 0.5;
         echo 0 > /proc/acpi/asus/mled;
         sleep 0.5;
       done
      (while replacing "/proc/acpi/asus/mled" with the path to your LED control file)
      Save it as mledBlink, make it executable using
      Code:
      chmod +x mledBlink
      test if it's doing what it's supposed to do
      Code:
      ./mledBlink
      and set the program to run it when there's an incoming call or message. In the skype 1.4 beta, this option is somewhat hidden in "Options -> Notifications -> Incoming Call Ringing -> Advanced View -> "Execute the following script:" (NOT "Execute the following script on any event").
      Code:
      ~/mledBlink
      does the trick. You can customize mledBlink to blink longer or more often to suite your needs by changing the for loop limit (6) and the sleep duration between on and off (0.5).


    Other programs are under investigation...

    Have a lot of fun!
    Last edited by Pedric; September 5th, 2007 at 04:40 PM.

  2. #2
    Join Date
    Sep 2007
    Location
    Warsaw, Poland
    Beans
    629
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: HOWTO: Led notifcation for new mail/messages/calls

    I don't have mled in my /proc/acpi/asus directory. Where can I download it?

  3. #3
    Join Date
    Apr 2005
    Location
    Olsztyn, Poland
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: HOWTO: Led notifcation for new mail/messages/calls

    You can control mail led via /sys/class/leds/asus:mail/brightness but you have to change permissions first.

  4. #4
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: HOWTO: Led notifcation for new mail/messages/calls

    Has anybody had any luck locating the LED control file for an Inspiron 1525 (or any similar model)?

  5. #5
    Join Date
    Jun 2008
    Location
    Narnia
    Beans
    784
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HOWTO: Led notifcation for new mail/messages/calls

    Anybody found it for Sony Vaios?

  6. #6
    Join Date
    Jan 2008
    Beans
    73

    Re: HOWTO: Led notifcation for new mail/messages/calls

    what would the path be for msi gx600s?

  7. #7
    Join Date
    May 2007
    Beans
    12

    Re: HOWTO: Led notifcation for new mail/messages/calls

    Hi!

    On my asus a6m, I did the following to get this working:

    Added these 2 lines to /etc/rc.local
    Code:
    chown root:users /sys/devices/virtual/leds/asus:mail/brightness
    chmod 664 /sys/devices/virtual/leds/asus:mail/brightness
    (I am in the users group)

    in this file:

    Code:
    ~/.mozilla-thunderbird/dk1mdfav.default/extensions/{2e1b75f1-6b5a-4f1d-89b4-424f636e4fba}/defaults/preferences/tray-biff.js
    I changed

    Code:
    pref("mail.biff.hw_indicator_file", "");
    to
    pref("mail.biff.hw_indicator_file", "/sys/devices/virtual/leds/asus:mail/brightness");



    Roti

  8. #8
    Join Date
    Jan 2008
    Location
    Brisbane
    Beans
    174
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: HOWTO: Led notifcation for new mail/messages/calls

    will this work on a desktop using the keyboard leds? i wouldnt mind having num lock flash...
    if so are there different steps to take to find the keyboard led files? cause im having no luck using the HowTO method...

    Edit: found how to turn on and off numblock, but how do i use the mail.biff.hw_indicator_file to run the script...at the moment its a boolean so i cant do much with it...
    Last edited by thestig_992; August 19th, 2008 at 12:33 PM.

  9. #9
    Join Date
    Apr 2006
    Location
    iceland
    Beans
    287
    Distro
    Ubuntu

    Re: HOWTO: Led notifcation for new mail/messages/calls

    Anyone that knows how to control leds on a dell m1210 laptop? Or any other dell laptop....? Or even if anyone know how I can find out how my led's are controlled?

    Thanks in advance!
    Quote Originally Posted by bodhi.zazen View Post
    At this time it is possible to run windows viruses with wine. They do not run well yet....http://os.newsforge.com/article.pl?s...30222&from=rss

  10. #10
    Join Date
    May 2008
    Location
    Germany
    Beans
    3
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Led notifcation for new mail/messages/calls

    For the IBM/Lenovo Thinkpad series, the LEDs are controlled by
    /proc/acpi/ibm/led
    According to this link, the association is as follows:
    0 - power
    1 - battery (orange)
    2 - battery (green)
    3 - UltraBase/dock
    4 - UltraBay
    5 - UltraBase battery slot
    6 - (unknown)
    7 - standby
    I had to first give my user the appropriate rights to control the power LED by putting this in my /etc/rc.local file:
    chown drskol:root /proc/acpi/ibm/led /sys/devices/platform/thinkpad_acpi/leds/tpacpi::power/brightness
    chmod 644 /proc/acpi/ibm/led /sys/devices/platform/thinkpad_acpi/leds/tpacpi::power/brightness
    Then these commands would turn the power LED (=0) off on my T60, have it blink or turn on resp.:
    echo "0 off" > /proc/acpi/ibm/led
    echo "0 blink" > /proc/acpi/ibm/led
    echo "0 on" > /proc/acpi/ibm/led
    I have not been able to find a way to toggle the Numlock / Capslock LED on my T60; however, they might be directly controlled over the firmware and not by the kernel!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •