Improvement idea: Shell script execution on new mails / read mails #33

Closed
SeniorSpielbergo opened this Issue Apr 29, 2012 · 15 comments

Projects

None yet

3 participants

@SeniorSpielbergo
Contributor

Hi,

I don't know where to put this, so I decided to open a bug although it is not a real bug.

I have got an usb email notifier (http://www.dreamcheeky.com/webmail-notifier) as a present for my birthday.
With the driver for linux it is possible to turn the notifier on and off via shell scripts / python scripts.

Now I had the idea it would be really great if you could add a possibility to run a user defined shell/python script on the new mail event (e.g. to turn the notifier on) and on the "all messages read" event (e.g. to turn it off).
I think there are a lot of different usage possibilities.

I'm not quite sure where I would have to add it to the code, otherwise I would try to add it myself.

Kind regards,

David

@foudfou
Owner
foudfou commented May 13, 2012

Hi, you should take a look at https://developer.mozilla.org/en/nsIProcess#Example.

A good start is probably updateMsgCount() function

And you'll have to add preference UI

@SeniorSpielbergo
Contributor

Thanks for your hints!

I will have a look at them and comment here if I've got anything working. Maybe a few others are interestent in this too.

@kevincox

I'm just gonna say I'm very intrested in this. If you could have some sort of API it would be awesome. For example arg 1 could be the number of messages and the rest of the args could be a string of "sender|subject" or something. Or stdin could be the messages one-per line. I'm not sure on the best way to doit but you could do some cool things.

@SeniorSpielbergo
Contributor

I already implemented basic functionality that allows to run a script on both events without any arguments.
I've send a pull request to foufou so hopefully it is available soon.
I will think about your ideas and these features, but it might take some time for me to implement them as I am busy right now with my bachelor thesis.

@kevincox

that's cool, I haven't tried out your version yet but adding argument passing shouldn't be hard to add. I might look into it if I get time.

I was thinking though, shouldn't this be a separate addon? I don't get how it is related to minimizing to the tray (other than notifications in the tray are nice). what are your thoughts?

@SeniorSpielbergo
Contributor

I'm not quite sure. On the one hand you are right because FireTray simply provides the possibility to minimize to the tray. But on the other hand it has all the functionality to get the number of mails and other related parameters.
Imho it would be great to have a separate addon with this functionality but it wouldn't be too reasonable to implement all these features again (respectively reuse the code) just to have the possibility to run external scripts.

@kevincox

Since this is a Unix-style addon it would make sense to harbor this feature
here, but as you said I don't know.
On May 24, 2012 9:21 AM, "David Wille" <
reply@reply.github.com>
wrote:

I'm not quite sure. On the one hand you are right because FireTray simply
provides the possibility to minimize to the tray. But on the other hand it
has all the functionality to get the number of mails and other related
parameters.
Imho it would be great to have a separate addon with this functionality
but it wouldn't be too reasonable to implement all these features again
(respectively reuse the code) just to have the possibility to run external
scripts.


Reply to this email directly or view it on GitHub:
#33 (comment)

@SeniorSpielbergo
Contributor

Maybe we just wait what foufou thinks and discuss afterwards. I think that might be the best idea as long it is his addon ;-)

@foudfou
Owner
foudfou commented May 24, 2012

@kevincox, in a way, the API already exists: all you describe should be achievable with bare XUL. What do you imagine by "some cool things" ? What are your needs exactly ? There is an addon suggestion forum BTW.

As to whether it should be a separate extension, again, this depends on your needs. My feelings are that if all you need for now is passing and getting a few arguments, it might not be worth the effort trying to extract relevant code from FireTray, and build addon dependency.
But if anyone is willing to do so, I'll be glad to help.

@kevincox

By API I meant that the called shell script would be given some
information (number of unread, subject, from, to, ...) I (and I think
David) was thinking about something a user could easily set up and that
"fancy" scripts could be shared.

@foudfou
Owner
foudfou commented May 30, 2012

Hi, I consider this issue as solved by David's contribution.
@kevincox, don't hesitate to open a new issue/request if you have further needs.

@foudfou foudfou closed this May 30, 2012
@foudfou
Owner
foudfou commented May 30, 2012

Hi, I consider this issue as solved by David's contribution.
@kevincox, don't hesitate to open a new issue/request if you have further needs.

@foudfou
Owner
foudfou commented May 30, 2012

Hi, I consider this issue as solved by David's contribution.
@kevincox, don't hesitate to open a new issue/request if you have further needs.

@foudfou
Owner
foudfou commented May 30, 2012

Hi, I consider this issue as solved by David's contribution.
@kevincox, don't hesitate to open a new issue/request if you have further needs.

@kevincox

I opened #41 for the enhancement of this feature. Please consider that a low-priority enhancement though. I just put it there so it doesn't get forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment