PDA

View Full Version : HOWTO: Led notifcation for new mail/messages/calls



Pedric
August 31st, 2007, 12:57 PM
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


/proc/acpi/asus/mled

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


echo 1 > /proc/acpi/asus/mled

2. Get plugins/extensions for your programs


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.
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.
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:

#!/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

chmod +x mledBlink
test if it's doing what it's supposed to do

./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").

~/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!

hotweiss
May 23rd, 2008, 08:11 PM
I don't have mled in my /proc/acpi/asus directory. Where can I download it?

miscz
May 24th, 2008, 03:09 PM
You can control mail led via /sys/class/leds/asus:mail/brightness but you have to change permissions first.

5m0k3
May 29th, 2008, 02:55 PM
Has anybody had any luck locating the LED control file for an Inspiron 1525 (or any similar model)?

fiddler616
July 15th, 2008, 08:58 PM
Anybody found it for Sony Vaios?

KillaW0lf04
July 22nd, 2008, 01:02 PM
what would the path be for msi gx600s?

Roti78
August 7th, 2008, 10:36 PM
Hi!

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

Added these 2 lines to /etc/rc.local

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:


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

I changed


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




Roti

thestig_992
August 16th, 2008, 12:57 PM
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...

gardara
September 4th, 2008, 11:46 AM
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!

drskol
November 2nd, 2008, 11:15 AM
For the IBM/Lenovo Thinkpad series, the LEDs are controlled by


/proc/acpi/ibm/led


According to this link (http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-02/msg03598.html), 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!

zetxx
January 2nd, 2009, 09:42 PM
i have asus m51vr but i dont have any asus:mail symlinks or directorys in /sys/devices/virtual/leds/. i had only:
iwl-phy0:assoc
iwl-phy0:radio
iwl-phy0:RX
iwl-phy0:TX
how i can get /sys/devices/virtual/leds/asus:mail/ ?

Roanoke
March 3rd, 2009, 01:27 AM
I have a dell Inspiron E1405, any idea where the LED is?

brk3
May 21st, 2009, 01:31 PM
If anyone found them for Dell inpiron 1525 please let me know!

kevinguillorytraining
October 10th, 2009, 05:42 AM
How can I control LED lights on my Dell Latitude E6400?


Thanks in advance