Swirly Mein Kopf

Monday, June 27. 2005

Created gaim-thinklight

Digital World

Because of Gnome 2.10's metacity focus stealing prevention feature, I would not notice new messaes in open gaim conversation windows. Since I have an IBM Thinkpad with a Thinklight attached to it (little LED on the top border of the display), I thought I'd use that to tell me about new messages.

Sitting here at the entropia again, I finished my gaim plugin hacking. Since the light is controlled via /proc, I had to write a suid program just to let the user control that file. That's not a nice solution, I wish /proc would be like /dev, where you just use chgrp et al to let the user control the devices. If any one is interested, I have (not very clean) debian packages.

Update: I have put okayish packages on http://people.debian.org/~nomeata/gaim-thinklight/. Comments are welcome. If there are enough comments, I'll consider putting it in debian, but only then, as it is quite specific.

Trackbacks


Lightweight Replacement for 111 lines of code
Chris Lamb has announced his gaim plugin “gaim-lightthink” both on his blog and on the thinkpad-linux mailing list. His plugin does basically the same thing as my gaim-thinklight plugin. I was a bit surprised to read that his plugin is supo
Weblog: nomeata's mind shares
Tracked: Nov 16, 18:04
I'm responsible for reduced attention in a NY university
Some Brett from Rensselaer Polytechnic Institute in Troy, NY writes on his blog that my gaim-thinklight plugin is bad for attention in class. Sorry, guys :-)
Weblog: nomeata's mind shares
Tracked: Oct 13, 14:01
gaim-thinklight → pidgin-blinklight
I once wrote a plugin gaim called gaim-thinklight, which simply blinks your ThinkPad’s ThinkLight when you get a new messge. Very recently, gaim was renamed to pidgin, so gaim-thinklight is now called pidgin-blinklight. I changed the second part not bec
Weblog: nomeata’s mind shares
Tracked: May 15, 23:05

Comments

Display comments as (Linear | Threaded)

*I would be very interested in said packages! Please share.

Thanks!
#1 Adam G on 2005-06-27 05:02 (Reply)
*I love it. Only one little bug that happens when you get two messages at almost the same time. The light gets "stuck" on because of a race condition.

If I have some free time I'll try and find a fix.

It would be nice too if it could periodically blink the light at a longer interval if you have unread messages.
#2 Chris (Homepage) on 2005-06-30 21:37 (Reply)
*Hi, nice to hear that people are using it.

I thought about the race condition. I might fix it by setting the timer for the turn-off-light from within the turn-on-function.
I am also thinking (nothing more :-)) about making the blink sequence configurational, and have it blink differnetly for different events.

I don't know if you can make it blink while unread messages wait when the messages was actually shown but the window stays hidden (the reason I created the plugin in the first case). I'm not sure gaim knows whether the messages was not read...

Comments and patches welcome.
#2.1 nomeata (Homepage) on 2005-06-30 21:50 (Reply)
*Very nice, thank you!
I added a note on http://www.thinkwiki.org/wiki/Ibm-acpi
#3 Arno Willig (Homepage) on 2005-07-16 21:00 (Reply)
*Please add this to debian. I am getting myself a Thinkpad shortly and would love this feature.
#4 Rolf (Homepage) on 2005-07-26 22:14 (Reply)
*It has been added, see http://packages.debian.org/unstable/net/gaim-thinklight (not in sarge, of course)
#4.1 nomeata (Homepage) on 2005-07-26 22:24 (Reply)
*What is the license for this software, please?
#5 Mike on 2005-08-03 18:18 (Reply)
*It's GPL, basically because I was too lazy to change the COPYING file from the gaim plugin that I used as a starting point :-).
#5.1 nomeata (Homepage) on 2005-08-03 18:45 (Reply)
*Nevermind. Found it
#6 Mike on 2005-08-03 18:20 (Reply)
*Works great, and I'm greatly amused! (It's useful too!)
One suggestion for development would be to be able to configure it to keep the light on until the message window gained focus, was typed in, etc. (like Message Notification plugin), in case you left the room or something and wanted to easily check whether any new messages had been received.
Also, being able to configure other options for how it blinks for different events would be fantastic.
#7 Tony Yarusso on 2005-10-07 08:23 (Reply)
*Glad to hear you like it. Keeping the light on is a good idea, but see comment #2.1. The blinking sequence is already saved in a way that should allow easy customation, but someone just needs to hack up an UI.

Not sure if I'll get around to do any of this soon, but patches are welcome.
#7.1 nomeata (Homepage) on 2005-10-07 10:46 (Reply)
*One other thing I noticed: If the light is already on, it will blink and end in the off state. In case someone was trying to use the light to work, would it be possible to have it blink and return to the state in was in previously? (By toggling its state rather than telling it to turn on and then off, or some such thing?)
#7.2 Tony Yarusso on 2005-10-07 21:27 (Reply)
*This was requested a few times now. If you run debian unstable, you can get version 0.2 with this version with apt-get upgrade. To get the files directly, see http://packages.debian.org/unstable/net/gaim-thinklight
#7.2.1 nomeata (Homepage) on 2005-10-07 21:38 (Reply)
*Hi... Im running GAIM 1.1.4 on Ubuntu Hoary. IBM ACPI is installed and running (can turn on light with echo on > /proc/acpi/ibm/light), but when I activate the plugin in GAIM, the program crashes when I receive an IM. Any ideas what might be going on?
#8 Alex Ravenel (Homepage) on 2005-10-20 14:50 (Reply)
*Nope, no idea. Can you provide a backtrace? Also, maybe it needs to be rebuilt against the version in Hoary. Did you get your package from ubuntu universe? Then you might want to file a bug in the ubuntu bug tracking system.
#8.1 nomeata (Homepage) on 2005-10-20 16:31 (Reply)
*Email sent with the backtrace. Thanks for the help.
#8.1.1 Alex Ravenel (Homepage) on 2005-10-20 17:51 (Reply)
*Did you ever find a fix for this? I'm having the same issues. Compiled w/ debug mode, reports:

The program 'gaim' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadGC (invalid GC parameter)'.
(Details: serial 4610 error_code 13 request_code 60 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
#8.1.1.1 Joe Glass (Homepage) on 2006-04-05 07:13 (Reply)
*Sorry, no idea. I don't think my plugin can cause X errors, as it does not do anything graphical...
#8.1.1.1.1 Joachim Breitner (Homepage) on 2006-04-05 12:45 (Reply)
*Cool idea. I'm working on setting it up now.
#9 phisrow on 2005-10-25 22:35 (Reply)
*Thanks!

Very cool feature. Here's hoping it works with the newest verison!
#10 Gaim-butt on 2005-11-18 07:53 (Reply)
*Great util, THANKS!
#11 Vinnie (Homepage) on 2005-12-07 18:42 (Reply)
*would it be possible to activate the light only when a message arrives in a window which is out of focus? the idea is simply great, but I get kind of annoyed if it is constantly blinking during a "talk".

thx,
wolfgang
#12 fechter on 2006-01-03 18:28 (Reply)
*Hi,

that idea makes sense, but I don't know enough about the internals of gaim, and I am currently too lazy to find out. If you or someone how ever can point me to the appropriate docs that tell me how to code that, I can certainly do that.
#12.1 Joachim Breitner (Homepage) on 2006-01-08 15:59 (Reply)
*hi joachim,

I'm completely clueless on this topic - but there is a routine in the regular preferences for the sound ("sounds when conversation has focus" yes/no) perhaps one can salvage something there?

danke für die antwort,
wolfgang
#12.1.1 fechter on 2006-01-09 01:11 (Reply)
*This comment box won't let me post my script or a link. Click the Link next to my name to see the script I call with 'blinklight %s'. Change delay and repeats to your liking.
#12.1.1.1 stephen (Homepage) on 2006-05-28 03:24 (Reply)
*Hi Joachim!
Short question: will there ever be an update to make it work on gaim v2?
thx!
#13 buvens on 2006-06-01 17:57 (Reply)
*No changes to the code are required, just re-compile it (if you have compiled it from source) or get the newest version from Debian experimental (see http://packages.debian.org/gaim-thinklight)
#13.1 Joachim Breitner (Homepage) on 2006-06-01 18:10 (Reply)
*Well installing the deb. package didn't work, but I got some help and finally it works now. Recompiling the sources solved the problem...

...and last but not least:
Great plugin! I love it :)
#13.1.1 buvens on 2006-06-02 14:10 (Reply)
*May I ask on what distribution the .deb did not work, and why it did not work?

Glad you like it!
#13.1.1.1 Joachim Breitner (Homepage) on 2006-06-02 15:02 (Reply)
*I was the one who helped him :) The debian experimental did not work on Ubuntu Dapper with unofficial gaim2 packages from
"deb http://people.ubuntu.com/~seb128/deb ./" (unofficial repo from the official ubuntu gaim maintainer). It did not work because the debian gaim is named 2.0 and the ubuntu one 1.99. So I recompiled the gaim-thinklight package from the official repos with gaim-dev 1.99. And now it works :) If you want, I can send you the .deb I made.

greets
fabio
#14 Fabio Berta on 2006-06-02 16:50 (Reply)
*I see, just a temporary problem until 2.0 gets into unstable and regular ubuntu. You could ask seb128 to put your deb along his gaim version in the meantime, if you want.
#14.1 Joachim Breitner (Homepage) on 2006-06-02 17:57 (Reply)
*Hello there!

Well, excellent plugin I must say, though I second the opinion of fechter that the blink should only occur in out of focus windows. I haven't found a way to do that yet, but I'm looking into it (no idea where to start!).

Secondly, how is this installed on a non-Debian system? I'm sure the source must be extractable somehow, but I'm unfamiliar with .debs.

Thanks
#15 Bob on 2006-07-12 00:34 (Reply)
*You can grab the .orig.tar.gz from http://packages.debian.org/unstable/net/gaim-thinklight and build it as usual. Note that you have to manually build and install the hinklight-fixperm program.

If anyone wants to fix this by fixing all that ugly autoconf stuff, I'll happily accept patches.
#15.1 Joachim Breitner (Homepage) on 2006-07-12 01:37 (Reply)
*Hi just installed the plugin and makes me feel happy happy :D
Keep up the good work, I've always known thinkpad is the best ;)
#16 marin on 2006-08-15 20:38 (Reply)
*any ports for windows?
#17 munkay on 2006-08-26 17:52 (Reply)
*Not from my side, and unless someone ports the /proc filesystem and the ibm kernel module to windows, not from my code. Sorry :-)
#17.1 Joachim Breitner (Homepage) on 2006-08-26 20:44 (Reply)
*I added some bits so the current state of the light before the message is left after the 'blink'. I think this is important because I may be using the light and I don't want it turned off when the blink is done.

It isn't pretty, but it works.

44a45
> #define LIGHT_STATUS "/tmp/ibm_light_status"
70a73
> char status_cmd[256];
71a75
> char write_cmd[256];
72a77
> char cmd2[1024] = "{ ";
73a79,95
> // Find the status of the light.
> sprintf(
> status_cmd,
> "cat %s | grep status | sed 's/.*\\\(o.*\\\)/\\1/' > %s ; ",
> LIGHT_FILE,
> LIGHT_STATUS
> );
>
> // Reset status of light
> sprintf(
> write_cmd,
> "cat %s > %s ; ",
> LIGHT_STATUS,
> LIGHT_FILE
> );
>
>
85a108
> strcat(cmd, status_cmd);
89a113
> strcat(cmd, write_cmd);
#18 greg on 2006-09-27 19:30 (Reply)
*Thanks for the patch. Do you have the newest version? It _should_ keep the state already. If not, it's a bug...

Also, it's always nicer to get patches in the "unified" format ("-u"), and by mail.
#18.1 Joachim Breitner (Homepage) on 2006-09-28 16:24 (Reply)
*Crashed.

1. Successfully Compiled from source on Fedora Core 6 with Gaim 2.0.0-0.26.beta5.fc6.

2. Enabled plugin, gaim crashed.
3. Restarted Gaim, enabled plugin, gaim stayed running with weird gui problems.
4. Gaim crashed.
5. restarted gaim, gaim crashed.
6. removed plugin files from /usr/lib/gaim/...restarted gaim.

Done.

it's late...i'm going to bed.
#19 Vince on 2007-02-05 08:06 (Reply)
*Sorry, it is not crashing here, so I need your help to get that fixed, if it is a problem with gaim-thinklight at all. I am surprised that it affects the GUI: What kind of GUI problems are that? Does it also happen with gaim-text (if FC6 ships that)? Can you run it in gdb or strace to see when it is crashing? Is it crashing when a new message arrives?
#19.1 Joachim Breitner (Homepage) on 2007-02-05 10:29 (Reply)
*I'm experiencing the same thing.
#19.2 Bryan (Homepage) on 2007-02-14 06:05 (Reply)
*Again, I’m at a loss what is causing this.

Could you, Bryan, try to produce a backtrace with gdb? Are you also on FC6?
#19.2.1 Joachim Breitner (Homepage) on 2007-02-14 12:59 (Reply)
*Joachim,

Are there any plans to release a new vesion for Pidgin (Gaim's successor)?
So far I think this is the best plugin ever if you have a Thinkpad!
#20 Hendrik-Jan (Homepage) on 2007-05-11 13:44 (Reply)
*Yes, there are plans and I hope I’ll get around to do it beginning of next week.

I’ll also probably name it “pidgin-blinklight”, because it now supports ASUS laptops (or so I’ve heard, I coudn’t test that code of mine :-))

If I haven’t done it next week tuesday, feel free to bug me by mail, ICQ or Jabber . And thanks for the praise!
#20.1 Joachim Breitner (Homepage) on 2007-05-11 14:03 (Reply)
*do you intend to include any of the discussed features? I'm still hoping for the "only blink if out of focus"-feature, otherwise it is far too annoying. :)

ansonsten: gute arbeit,
wolfgang
#20.1.1 fechter on 2007-05-11 14:30 (Reply)
*I’m still not interested a lot in that feature myself. But if someone provides a patch (or maybe a gift certificates for the movies or amazon ;-)), it would be implemented as an option.
#20.1.1.1 Joachim Breitner (Homepage) on 2007-05-11 14:36 (Reply)
*Allright, I have some packages here. I don’t know when I will upload them to Debian, but if you want to test them: You are welcome! Comments appreciated, of course.

http://people.debian.org/~nomeata/gaim-thinklight/
#20.1.2 Joachim Breitner (Homepage) on 2007-05-11 16:27 (Reply)
*Hi .. nice tool, though it would be cool if there was an option to keep the light on until I read the message .. this would be pretty helpful if you're not always at your laptop and it is therefore locked, so you don't even see the blinking tray-icon
#21 Martin Raißle on 2008-06-07 23:00 (Reply)
*Sure, why not. I’ll accept patches :-)
#21.1 Joachim Breitner (Homepage) on 2008-06-09 11:49 (Reply)
*Hi!
Wouldn't it be possible to adapt that for a thunderbird addon/plugin ?
Thanks, Dirk
#22 Dirk Haar on 2010-07-11 18:08 (Reply)
*It would probably be possible – you just have to convince someone to create it...
#22.1 Joachim Breitner (Homepage) on 2010-07-11 22:28 (Reply)

Add Comment



To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

What is the first name of the owner of this blog? / Wie heißt der Betreiber dieses Blogs mit Vornamen?
 
 
Nach oben