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

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

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

 
Thread Tools Display Modes
Old August 31st, 2007   #1
Pedric
5 Cups of Ubuntu
 
Join Date: Aug 2005
Beans: 18
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
Old May 23rd, 2008   #2
hotweiss
Dipped in Ubuntu
 
hotweiss's Avatar
 
Join Date: Sep 2007
Location: Calgary, AB
Beans: 577
Ubuntu Jaunty Jackalope (testing)
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?
hotweiss is offline   Reply With Quote
Old May 24th, 2008   #3
miscz
A Carafe of Ubuntu
 
miscz's Avatar
 
Join Date: Apr 2005
Location: Sopot/Olsztyn, Poland
Beans: 60
Ubuntu 7.10 Gutsy Gibbon
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.
__________________
This is not a signature.
miscz is offline   Reply With Quote
Old May 29th, 2008   #4
5m0k3
First Cup of Ubuntu
 
Join Date: Mar 2006
My beans are 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)?
5m0k3 is offline   Reply With Quote
Old July 15th, 2008   #5
fiddler616
Has an Ubuntu Drip
 
fiddler616's Avatar
 
Join Date: Jun 2008
Location: An Alternate Dimension
Beans: 709
Ubuntu 9.04 Jaunty Jackalope
Send a message via AIM to fiddler616
Re: HOWTO: Led notifcation for new mail/messages/calls

Anybody found it for Sony Vaios?
fiddler616 is offline   Reply With Quote
Old July 22nd, 2008   #6
KillaW0lf04
Just Give Me the Beans!
 
Join Date: Jan 2008
Beans: 67
Re: HOWTO: Led notifcation for new mail/messages/calls

what would the path be for msi gx600s?
KillaW0lf04 is offline   Reply With Quote
Old August 7th, 2008   #7
Roti78
First Cup of Ubuntu
 
Join Date: May 2007
Beans: 6
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
Roti78 is offline   Reply With Quote
Old August 16th, 2008   #8
thestig_992
Gee! These Aren't Roasted!
 
thestig_992's Avatar
 
Join Date: Jan 2008
Location: Brisbane
Beans: 167
Ubuntu 9.04 Jaunty Jackalope
Send a message via MSN to thestig_992
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 07:33 AM..
thestig_992 is offline   Reply With Quote
Old September 4th, 2008   #9
gardara
Way Too Much Ubuntu
 
gardara's Avatar
 
Join Date: Apr 2006
Location: iceland
Beans: 276
Xubuntu 9.04 Jaunty Jackalope
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
gardara is offline   Reply With Quote
Old November 2nd, 2008   #10
drskol
First Cup of Ubuntu
 
Join Date: May 2008
Location: Germany
Beans: 3
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
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!
drskol 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 06:30 PM.


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