Pidgin and skype message led-notification

By Thomas Preindl
I found it a good idea using my mail-notification led to notify me about a new message received with skype or pidgin. For this reason I found a nice plugin for pidgin written by Simo Mattila.

First step: Let there be light!

First you have to find how you can control the led. It will be a “special file” somewhere in your file system. Depending on your laptop and kernel version, it could either be in /sys/ or in /proc/acpi/.

For example on a newer ASUS laptop the following commands should switch the LED on:

sudo chmod o+w /sys/class/leds/asus::mail/brightness
echo 1 > /sys/class/leds/asus::mail/brightness

The first line allows all users to write to the led-control file (/sys/class/leds/asus::mail/brightness). The second line writes “1” to the file to activate the led. To deactivate it just set it “0” again with:

echo 0 > /sys/class/leds/asus::mail/brightness

In older kernel versions the file was named /proc/acpi/asus/mled.

Put it into your rc.local

The permission to edit the led control file is lost after a reboot and you have to redo the chmod step every time. Thus put the commands into your rc.local script (which will be executed at boot). Open the rc.local file with:

sudo gedit /etc/rc.local

then insert this line before the exit 0 at the end:

chmod o+w /sys/class/leds/asus::mail/brightness

Enable skype blinking

Skype allows you to configure a script being executed when an event occurs. Save the following script to a file:

#!/bin/bash
for((i=0; i < 6; i++)) do
echo 1 > /sys/class/leds/asus::mail/brightness;
sleep 0.5;
echo 0 > /sys/class/leds/asus::mail/brightness;
sleep 0.5;
done

Now make the script executable:

chmod +x "filename"

and try to run it:

./"filename"

Now the led should flash, if not check the syntax or permission/location of the led control file. Now open skype-options and go to “Notification>Incoming Text Message>Advanced View>“Execute the following script:” and enter the path of your script.

Enable pidgin blinking

To enable pidgin to control your LED you have to download and compile the plugin LED-Notification-0.1 written by Simo Mattila. Unpack the files and open a terminal and change to the extracted directory e.g.,

cd ~/Desktop/led-notification-0.1

save the file and type the following commands in your terminal.

sudo apt-get install pidgin-dev
make

Don't do make install

sudo cp led-notification.so /usr/lib/purple-2/

If make is not working you have to find out which library dependencies are missing and install these packages with the synaptic package manager. If everything is working properly, restart pidgin and activate the plugin (Crtl+U) “Led-notification 0.1”. Click “configure plugin” and enter the path of your LED-control-file. It should be working by now. Enjoy it!

devlog/blog/laptop_led_notification_for_pidgin.txt · Last modified: 2009/04/26 17:41 by tom
Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! DevLog Atom feed Valid XHTML 1.0