Subscription date : 26 April 2010
Messages : 7
|
Hello,
I've been using the dock and the mail applet for some time now, and I want to say that they are quite useful. Thanks for creating this great software.
I really like the Mail applet, and recently began experimenting with playing various sounds as a notification when new mail arrives in my Inbox. I was reading elsewhere about the speech-dispatcher program which is included or can be added to the various Linux distributions.
My question is: is it possible to add the ability to run a script when mail arrives, rather than just play a sound? This way, speech-dispatcher could be used to generate a spoken notification. Depending on information available from the mail applet, the script could say something similar to "Robert, you have six e-mails."
Thanks for your consideration,
Robert63 |
Subscription date : 30 November 2007
Messages : 17118
|
well, you can try to hack the code (it's quite easy, replace cairo_dock_play_sound(myConfig.cNewMailUserSound); by cairo_dock_launch_command ("/path/to/your/script.sh");), and see what you can come up with
launching a script might be a good idea, maybe it could be used in others applets too |
Guest, Saturday 30 March 2013 à 19:05
|
|
|
fabounet : well, you can try to hack the code (it's quite easy, replace cairo_dock_play_sound(myConfig.cNewMailUserSound); by cairo_dock_launch_command ("/path/to/your/script.sh");), and see what you can come up with
launching a script might be a good idea, maybe it could be used in others applets too
This worked quite well. I had to get the relevant programs to compile and build for my Linux Mint 14 MATE (64-bit) system, and used bzr to pull the 3.2.0 source code. The install instructions provided on this site are excellent. If you decide to add this to the main branch, perhaps give users an option to play a sound or run a script....could it be useful to do both at the same time?
I agree that this could be useful in other applets where a similar state change occurs.
I also noticed that just below the line where I made the change is the if block that tests and prints the notification messages for single/multiple mails. If I can pass this line to my script with the count variable expanded, then it would be precisely what I was looking for when I made the original post.
Thanks for your guidance,
Robert |
fabounet, Saturday 30 March 2013 à 19:17
|
|
Subscription date : 30 November 2007
Messages : 17118
|
you can build the command with something like that:
gchar *cmd = g_strdup_printf ("/path/to/script.sh %d", number-of-mails);
cairo_dock_launch_command (cmd);
g_free (cmd); |
|