a) respective system alerts (indicating message content and type),
b) with a pop-up tray icon showing type of message by icon, and
c) with some RGB LED wired to a RS232toUSB-adapter via a small picaxe08m microcontroller, which lights up in the corresponding color (twitter is turquoise, pidgin is purple, email is red).
When the pop-up tray icon is clicked the LED is switched off, receiving numerous messages at the same time will cause several pop-up tray icons to appear.
It took me a while to get familiar with the python-twitter API interface, especially since I'm totally new to writing python code at all! Therefore the code is most definitely not the smartest, experienced python programmers feel free to improve this (you can also contact me to join the sourceforge project as a developer, help is always welcome!).
But at least it works. Without errors and with all features I wanted it to have.
And I've also learned to like twitter during writing the code..
Everyone interested can download my "dBird-notifier" python scripts v1.0 (packed as a .tar.gz archive including installation instructions) from here:
http://sourceforge.net/projects/dbirdnotifier/
some screenshots will maybe follow soon.
UPDATE
i just figured out that you can assign each device a unique symbolic link in /dev by writing a custom "udev" rule for it. I wrote a udev rule for the RS232 converter I'm using that causes the LED notifier device to be always visible as "/dev/LEDnotifer" when plugged in. I have edited all my ".py" scripts to point to this device node for ease and consistency (before the notifier device was sometimes /dev/ttyUSB0 and sometimes /dev/ttyUSB3 which was quite annoying since required me to edit three files by hand each time the system booted. Now thats not necessary anymore).
Here's my udev rule (store as "/etc/udev/rules.d/70-persistent-aserial.rules"):
BUS=="usb", KERNEL=="ttyUSB?", SYSFS{idProduct}=="2303", SYSFS{idVendor}=="067b", SYMLINK+="LEDnotifier"(yep it's just one single line)
If you are using a different serial->USB adapter cable you might need to adjust the {idProduct} and {idVendor} tags with the values shown by "lsusb" for your device, i.e. open a terminal, type "lsusb" with and without adapter cable inserted, then indentify the product and vendor id of your adapter, then place these in your udev rule. Restart the udev service by running "sudo /etc/init.d/udev reload" inside a terminal.
Then, finally, edit your ".py" script files to point to the new "/dev/LEDnotifier" symlink, and start "BirdNotify_TrayVersion.py" as usual. Voilá.
No comments:
Post a Comment