Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old August 31st, 2007   #1
Pedric
5 Cups of Ubuntu
 
Join Date: Aug 2005
Beans: 20
Ubuntu 9.10 Karmic Koala
Send a message via ICQ to Pedric
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 11:40 AM..
Pedric is offline   Reply With Quote
 

Bookmarks

Thread Tools
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

Forum Jump


All times are GMT -4. The time now is 04:09 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry