Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

Solution: blink ThinkLight for incoming mails

Forum for scripts, utilities like TPFanControl, IBM-ECW, 2-finger scrolling, etc.
Post Reply
Message
Author
yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Solution: blink ThinkLight for incoming mails

#1 Post by yak » Wed Nov 26, 2008 5:22 pm

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.
Last edited by yak on Mon Jan 26, 2009 5:35 pm, edited 2 times in total.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

jworman
Posts: 5
Joined: Wed Oct 26, 2005 8:57 pm
Location: La Luz, NM

Re: Solution: blink ThinkLight for incoming mails

#2 Post by jworman » Sat Nov 29, 2008 9:58 pm

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

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#3 Post by yak » Sat Nov 29, 2008 11:02 pm

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

lexicon
Freshman Member
Posts: 88
Joined: Sat Apr 26, 2008 9:09 pm
Location: Java
Contact:

#4 Post by lexicon » Wed Dec 03, 2008 12:36 pm

I downloaded ThinklightYamb.exe, tested it on T42p and X60.
It doesn't work.
I'm running XP.
T60p[2.0/4G/MomentusXT/ABG/UXGA/W7]
Past:701c T23 T4 T6 X3 X4 X6s

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#5 Post by yak » Wed Dec 03, 2008 12:55 pm

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

Radioguy
ThinkPadder
ThinkPadder
Posts: 1124
Joined: Fri Feb 29, 2008 2:45 pm
Location: New York, New Yorrrrrk

#6 Post by Radioguy » Wed Dec 03, 2008 3:37 pm

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?
240, 380ED, 760C, 760CD, 760E, 760EL, 760LD, 760LD, 760XD, 760XD, A30, E520, G40, I1300, P53, R31, R40, R51, R52, R61, T20, T30, T40, T41, T42, T43, T43P, T60, T61, T400, T410, T420, T430, T460, X1C2, X30, X40, X220, X301 and on, and on, and on...

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#7 Post by yak » Wed Dec 03, 2008 4:35 pm

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

jworman
Posts: 5
Joined: Wed Oct 26, 2005 8:57 pm
Location: La Luz, NM

Thinklightyam

#8 Post by jworman » Wed Dec 03, 2008 6:13 pm

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

Radioguy
ThinkPadder
ThinkPadder
Posts: 1124
Joined: Fri Feb 29, 2008 2:45 pm
Location: New York, New Yorrrrrk

#9 Post by Radioguy » Wed Dec 03, 2008 6:30 pm

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?
240, 380ED, 760C, 760CD, 760E, 760EL, 760LD, 760LD, 760XD, 760XD, A30, E520, G40, I1300, P53, R31, R40, R51, R52, R61, T20, T30, T40, T41, T42, T43, T43P, T60, T61, T400, T410, T420, T430, T460, X1C2, X30, X40, X220, X301 and on, and on, and on...

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#10 Post by yak » Thu Dec 04, 2008 6:56 am

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

jworman
Posts: 5
Joined: Wed Oct 26, 2005 8:57 pm
Location: La Luz, NM

Re: Thinklight.exe

#11 Post by jworman » Fri Dec 05, 2008 12:41 am

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

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#12 Post by yak » Fri Dec 05, 2008 9:31 am

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

jworman
Posts: 5
Joined: Wed Oct 26, 2005 8:57 pm
Location: La Luz, NM

Re: Thinklight.exe

#13 Post by jworman » Fri Dec 05, 2008 11:40 am

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

jworman
Posts: 5
Joined: Wed Oct 26, 2005 8:57 pm
Location: La Luz, NM

Re: Thinklight.exe

#14 Post by jworman » Fri Dec 05, 2008 11:46 am

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

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

#15 Post by yak » Fri Dec 05, 2008 3:44 pm

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
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

lexicon
Freshman Member
Posts: 88
Joined: Sat Apr 26, 2008 9:09 pm
Location: Java
Contact:

#16 Post by lexicon » Fri Dec 05, 2008 6:29 pm

Nice work done...
Tested on X60, XP SP3. Works well.

Thank you
T60p[2.0/4G/MomentusXT/ABG/UXGA/W7]
Past:701c T23 T4 T6 X3 X4 X6s

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Re: Solution: blink ThinkLight for incoming mails

#17 Post by yak » Tue Sep 15, 2009 4:04 pm

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 :).
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

usernotabuser
Freshman Member
Posts: 52
Joined: Fri Oct 17, 2008 8:43 pm
Location: Tallahassee, FL

Re: Solution: blink ThinkLight for incoming mails

#18 Post by usernotabuser » Sat Sep 26, 2009 9:23 am

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
Simple is as simple does.

Sindbad
Freshman Member
Posts: 74
Joined: Sat Jan 09, 2010 10:40 pm
Location: Brooklyn NY

Re: Solution: blink ThinkLight for incoming mails

#19 Post by Sindbad » Sun Jan 31, 2010 7:25 pm

the topic is kinda old but... is there any script to integrate it with MSN Messenger

Today: Apple MacBook Pro 13 (Late 2011)
In past: T400s , X300 , T400 (P8400) , X41 Tablet and R52

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Re: Solution: blink ThinkLight for incoming mails

#20 Post by yak » Sun Jan 31, 2010 9:15 pm

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

Radioguy
ThinkPadder
ThinkPadder
Posts: 1124
Joined: Fri Feb 29, 2008 2:45 pm
Location: New York, New Yorrrrrk

Re: Solution: blink ThinkLight for incoming mails

#21 Post by Radioguy » Tue Feb 02, 2010 5:25 pm

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.
240, 380ED, 760C, 760CD, 760E, 760EL, 760LD, 760LD, 760XD, 760XD, A30, E520, G40, I1300, P53, R31, R40, R51, R52, R61, T20, T30, T40, T41, T42, T43, T43P, T60, T61, T400, T410, T420, T430, T460, X1C2, X30, X40, X220, X301 and on, and on, and on...

eyeland
Sophomore Member
Posts: 178
Joined: Mon Sep 07, 2009 11:02 am
Location: Copenhagen, Denmark

Re: Solution: blink ThinkLight for incoming mails

#22 Post by eyeland » Sun Nov 14, 2010 3:16 pm

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!
W530 FHD - 32GB Ram - K2000m - >1TBSSD |
Modded T61| Scarlet Saffire 6i6-Phillips IPS | Win10x64
---
daybreak broke me loose and brought me back...

eyeland
Sophomore Member
Posts: 178
Joined: Mon Sep 07, 2009 11:02 am
Location: Copenhagen, Denmark

Re: Solution: blink ThinkLight for incoming mails

#23 Post by eyeland » Sun Nov 14, 2010 4:32 pm

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 :)
W530 FHD - 32GB Ram - K2000m - >1TBSSD |
Modded T61| Scarlet Saffire 6i6-Phillips IPS | Win10x64
---
daybreak broke me loose and brought me back...

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Re: Solution: blink ThinkLight for incoming mails

#24 Post by yak » Sun Nov 14, 2010 5:16 pm

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.
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

eyeland
Sophomore Member
Posts: 178
Joined: Mon Sep 07, 2009 11:02 am
Location: Copenhagen, Denmark

Re: Solution: blink ThinkLight for incoming mails

#25 Post by eyeland » Thu Nov 18, 2010 12:10 pm

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
W530 FHD - 32GB Ram - K2000m - >1TBSSD |
Modded T61| Scarlet Saffire 6i6-Phillips IPS | Win10x64
---
daybreak broke me loose and brought me back...

eyeland
Sophomore Member
Posts: 178
Joined: Mon Sep 07, 2009 11:02 am
Location: Copenhagen, Denmark

Re: Solution: blink ThinkLight for incoming mails

#26 Post by eyeland » Thu Nov 18, 2010 1:21 pm

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? :)
W530 FHD - 32GB Ram - K2000m - >1TBSSD |
Modded T61| Scarlet Saffire 6i6-Phillips IPS | Win10x64
---
daybreak broke me loose and brought me back...

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “ThinkPad Utility Work Area”

Who is online

Users browsing this forum: No registered users and 21 guests