Page 1 of 1

Solution: blink ThinkLight for incoming mails

Posted: Wed Nov 26, 2008 5:22 pm
by yak
Hi,

I would like to show you how to make the ThinkLight blink when you receive a mail in Thunderbird on Windows.

I had this working before on my T41 with XP using a Thunderbird extension called Yet Another Mail Biff which allows you to run an arbitrary program when an e-mail is received. I have used my own Python script to do the actual blinking.

It also worked on T60/XP. It stopped working when I got Vista. As it turned out, the Python script wasn't able to control the ThinkLight anymore because of a change in Lenovo drivers.

So I had a look at this today and as a result I have a small program, written in C this time, that does the blinking and it works on Vista without problems. It should work on XP too (it has additional code for the older way of doing this) but this is untested as I don't have XP on my ThinkPad anymore to test this.

If anyone with XP could test it, it would be cool.

So, here's how to set it up:

Download the ThinkLightYamb.exe file (this is the tool I wrote) and save it anywhere you like.

You can test the tool right now just by starting it. It should just blink the ThinkLight six times without opening any windows.

Download the Yet Another Mail Biff (YAMB) extension and install it.

Go to the YAMB config, open the file dialog and select the ThinkLightYamb.exe. Now if you press the Test button the ThinkLight should blink. You can now customize the blinking. Add a space and a number after the path. This is the number of times the light will blink. You can also add another number which is the speed (number of blinks per second).

The tool requires the Lenovo System Interface Driver to be installed for Vista or Hotkey utility for XP. If you have OSD for volume, brightness and the rest, you got it already.

Let me know what you think.

Cheers,
yak

BTW, if anyone is interested in ThinkLight control code, let me know. I have C source that can check if the ThinkLight is available, get its state (on/off) and set it of course.

-- EDIT --

A command line utility to control the ThinkLight has also been created:
ThinkLight.exe

Please note that the test release links found in following posts are dead now as the issued they are created to test were resolved.

Re: Solution: blink ThinkLight for incoming mails

Posted: Sat Nov 29, 2008 9:58 pm
by jworman
If I understand your post, running your program "Thinklightyamb.exe" should cause the Thinklight to blink 6 times. I'm running XP Pro on a R61i and the program doesn't seem to do anything when I run it.

It sounds like a great idea. I'm sorry it doesn't work on my machine.

John

Posted: Sat Nov 29, 2008 11:02 pm
by yak
Yes, it should. If it doesn't then I've messed up something. Like I said, it was tested on Vista only which does this differently (the tool detects Vista internally). Thanks for the info, I'll investigate.

Posted: Wed Dec 03, 2008 12:36 pm
by lexicon
I downloaded ThinklightYamb.exe, tested it on T42p and X60.
It doesn't work.
I'm running XP.

Posted: Wed Dec 03, 2008 12:55 pm
by yak
Yes, there's a bug when running on XP. I'll post here a new version as soon as I get some free time to make it.

Posted: Wed Dec 03, 2008 3:37 pm
by Radioguy
I suppose it's asking too much to have this work for Windows Mail, or Windows Live Mail? ;)

I've tried Thunderbird before, but had issues with adding all my email accounts (mainly the hotmail ones). I also like the WM layout, which is still closer to Outlook Express, which I'm used to.

One other thing...if I had Thunderbird anyhow, is there a way to have the light blink indefinitely until the email is checked?

Posted: Wed Dec 03, 2008 4:35 pm
by yak
Here's the second release to be tested on XP. I've already tested on Vista, still works :).

ThinkLightYamb_r2.exe

Please, if you're going to test this, make sure you have the Lenovo Hotkey drivers installed.

Radioguy wrote:I suppose it's asking too much to have this work for Windows Mail, or Windows Live Mail? ;)

I've tried Thunderbird before, but had issues with adding all my email accounts (mainly the hotmail ones). I also like the WM layout, which is still closer to Outlook Express, which I'm used to.

One other thing...if I had Thunderbird anyhow, is there a way to have the light blink indefinitely until the email is checked?
I've never used Windows Mail, Live Mail or Outlook so I don't know their expandability capabilities. What's needed is a way to start a program when an e-mail is received - that's what the YAMB Thunderbird extension gives us.

Your idea about indefinite blinking is nice but having it stop when the e-mail is read could be difficult. However, I think that blinking until user input is detected but for at least 3 seconds or so should be sufficient.

Thinklightyam

Posted: Wed Dec 03, 2008 6:13 pm
by jworman
Hi,

I tried version 2 of your program. I still don't get a blinking Thinklight running XP pro (SP-2). I do have the Lenovo System Interface Driver, or at least I have the OSD for volume, brightness and the rest.

Thank you for another attempt.

John

Posted: Wed Dec 03, 2008 6:30 pm
by Radioguy
yak wrote:Your idea about indefinite blinking is nice but having it stop when the e-mail is read could be difficult. However, I think that blinking until user input is detected but for at least 3 seconds or so should be sufficient.
Actually, that's all that I should have asked for. Having it stop only when the mail is read is overkill. :)

I have no idea if WM or WLM have that same functionality, but if you have Vista, you at least have WL already. So do I, but I installed WLM and use that instead since I wanted the option of removing it if I wanted to.

I do know that when new mail is received in WLM, that a different icon appears in the taskbar (replacing the regular program icon). Perhaps that's something you could use to trigger the light?

Posted: Thu Dec 04, 2008 6:56 am
by yak
Another try.

ThinkLightYamb_r3.exe

This one also implements the Radioguy idea. It blinks until a mouse is moved or key is pressed. It can take up to two arguments, minimal number of blinks (default 6) and blinking speed (blinks per second, default 3).

Let me know if it finally works on XP. I really hope to get it working without switching HDDs in my ThinkPad and installing XP + drivers + development environment.

I've also written a small command line utility to control the ThinkLight based on the same control code used by the ThinkLightYamb.exe.

ThinkLight.exe

Just get to the command prompt and start it without any args. It will print out the usage instructions.

It can also help testing this on XP since unlike ThinkLightYamb.exe, it displays some error messages.

Radioguy, I'll try to take a look at Windows Mail if time permits.

Re: Thinklight.exe

Posted: Fri Dec 05, 2008 12:41 am
by jworman
It looks like the problem is on my end. I'll dig out my old A30 and see if it will work.

Using thinklight.exe I get the following:


C:\download\thinklight>thinklight toggle
Error: could not access the ThinkLight,are the drivers installed?

As my onscreen indicators are working, I'm not sure what drivers I should have installed.


John

Posted: Fri Dec 05, 2008 9:31 am
by yak
I really hope I have this right this time.

ThinkLightYamb_r4.exe
ThinkLight_r2.exe

Let me know. And thanks for testing.

@jworman

The Hotkey drivers which you obviously have installed if you have the on screen indicators. The error you got is a result of a bug in my tool. Please try the new version.

Re: Thinklight.exe

Posted: Fri Dec 05, 2008 11:40 am
by jworman
You certainly do have it right with V4 (and V2 of Thinklight.exe).

Running ThinklightYamb_r4.exe from windows causes the light to blink about 30 times.

Running ThinklightR_2.exe from the command line with arguments works just as you said it would.

Thank you for fixing these programs so they will work for us old fuddys that refuse to move to Vista.

John

Re: Thinklight.exe

Posted: Fri Dec 05, 2008 11:46 am
by jworman
Hi,

Now when I run ThinkLightyamb_r4 it blinks 6 times like you originally said it would. I don't know where the 30 times I got earlier came from. It doesn't matter, as it does blink very nicely.

Thanks again.

John

Posted: Fri Dec 05, 2008 3:44 pm
by yak
Finally :). Thanks for testing.

The ThinkLightYamb_r4.exe blinks at least 6 times. If you won't move the mouse or press any keys it will blink until you do so. The minimal number of blinks can be changed by passing a value as argument, for example by running from command line (or from Thunderbird's YAMB extension, as it's supposed to be used). A second argument can also be passed which tells how many times per second should the LED blink, i.e. it is the speed of blinking.

So, since it finally works, I've removed all these various test releases (links won't work anymore). Here are the final ones:

ThinkLightYamb.exe
ThinkLight.exe

Posted: Fri Dec 05, 2008 6:29 pm
by lexicon
Nice work done...
Tested on X60, XP SP3. Works well.

Thank you

Re: Solution: blink ThinkLight for incoming mails

Posted: Tue Sep 15, 2009 4:04 pm
by yak
The ThinkLightYamb.exe file has been updated.

In the new version if no user input (keypress, mouse movement) is detected for 60s, the blinking is slowed down. This means that if you're away, the light won't be blinking in techno-rythm for several hours :).

Re: Solution: blink ThinkLight for incoming mails

Posted: Sat Sep 26, 2009 9:23 am
by usernotabuser
First off, nice app and thanks for sharing.

Second, any ideas/leads on a similar app for firefox (specifically Gmail)?

I remember there was an app that did this exact same thing but it was for Pigdin (IM client) but only worked under Linux. Needless to say, I was pretty jealous of my friend's laptop having the feature.

Hope springs eternal.

D

Re: Solution: blink ThinkLight for incoming mails

Posted: Sun Jan 31, 2010 7:25 pm
by Sindbad
the topic is kinda old but... is there any script to integrate it with MSN Messenger

Re: Solution: blink ThinkLight for incoming mails

Posted: Sun Jan 31, 2010 9:15 pm
by yak
I don't know. The whole thing consists of a small tool that blinks the ThinkLight and a Thunderbird extension that allows you to run executable files when a mail is received. To make the ThinkLight bink on any other event, you have to find a way to run the blinking tool when this event takes place. I don't know if MSN has such an option, probably not.

Re: Solution: blink ThinkLight for incoming mails

Posted: Tue Feb 02, 2010 5:25 pm
by Radioguy
Alas, I still haven't weened myself off WLM to TB. Plus, I still don't know of a way to start a program from within WM or WLM once mail is received, short of the fact they change the taskbar icon once it has.

Re: Solution: blink ThinkLight for incoming mails

Posted: Sun Nov 14, 2010 3:16 pm
by eyeland
first of all, this is an awesome idea, it is beyond me why we don't have more control over the leds on our machine in the first place (eg, the ability to turn off ALL leds for moviewatching as well as setting up LEDS and thinklight to trigger on different events)
Any new development on this topic? I'd love to help but alas my coding skills are very limited..
My intuition tells me that implementing gmail support should be easy since many desktopapps (eg rainmeter) seem to be able to get reads easily?
Either way, I don't really understand the current limits of your programs application?
Does it only work with thunder?
Wanna share the source so I can find someone to develop for it? Do you have time to play with a few other ideas of implementation, such as skype, msn or the likes?
Or perhaps warning blinks on critical temperatures in conjunction with tpfancontrol? Perhaps the auther of the latter could be persuaded to implement thinklight as a feature?

Anyways, thanks alot for the work!

Re: Solution: blink ThinkLight for incoming mails

Posted: Sun Nov 14, 2010 4:32 pm
by eyeland
hmm can't seem to get it to work in conjunction with Thunderbird.. Fresh Thunderinstall, everything seems to work, app launches when I click "test" but not when a new message arrives.. any ideas? Using Win 7 64U with UAC on lvl 2 :)

Re: Solution: blink ThinkLight for incoming mails

Posted: Sun Nov 14, 2010 5:16 pm
by yak
As this is not the first time I'm asked for the source of the code controlling the ThinkLight, here it is for anyone to download (published under Apache 2.0 license):
http://arkadiusz.wahlig.eu/download/thinklightlib.zip

This contains a .c and .h files that provide a small set of functions for detecting ThinkLight availability and state as well as changing the state. This code is the result of above tests on different Windows versions and hides a lot of low level communications with drivers.

Now, to notify the user about some event using the ThinkLight, apart from this code one needs a way to detect the actual event. Skype, for example, has an API that lets you set it up to send notifications about incoming calls/messages to your program so it can blink the light. Other apps may lack such an API and thus pose a bigger problem.

The Thunderbird use case I used is based on a slightly different approach. The ThinkLightYamb.exe is just a small program that blinks the light using the above code. In itself, it doesn't have anything to do with Thunderbird. To connect this and Thunderbird I used a special extension (a plugin, just like extensions for Firefox) called YAMB that lets you start any program when mail arrive.
eyeland wrote:hmm can't seem to get it to work in conjunction with Thunderbird.. Fresh Thunderinstall, everything seems to work, app launches when I click "test" but not when a new message arrives.. any ideas? Using Win 7 64U with UAC on lvl 2 :)
Be sure to check the checkboxes for various folders in the settings. Check them all first, click OK and try sending yourself a mail.

Re: Solution: blink ThinkLight for incoming mails

Posted: Thu Nov 18, 2010 12:10 pm
by eyeland
Be sure to check the checkboxes for various folders in the settings. Check them all first, click OK and try sending yourself a mail.
I looked at the settings, asd everything was checked appart from "only inbox" and "convert to utf-8"
Still doesn't work, odd

Re: Solution: blink ThinkLight for incoming mails

Posted: Thu Nov 18, 2010 1:21 pm
by eyeland
Skype, for example, has an API that lets you set it up to send notifications about incoming calls/messages to your program so it can blink the light.
I cannot for the life of me find any such app for skype, mind dropping a link? :)