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
- 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:
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
test if it's doing what it's supposed to do
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").
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!
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?
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.
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)?
Re: HOWTO: Led notifcation for new mail/messages/calls
Anybody found it for Sony Vaios?
Re: HOWTO: Led notifcation for new mail/messages/calls
what would the path be for msi gx600s?
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
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...
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!
Re: HOWTO: Led notifcation for new mail/messages/calls
For the IBM/Lenovo Thinkpad series, the LEDs are controlled by
Quote:
/proc/acpi/ibm/led
According to this link, the association is as follows:
Quote:
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:
Quote:
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.:
Quote:
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!