Linux tip, Fedora tip / howto: make gmail notifier read out e-mail sender and subject

 
Note that these tips are mostly outdated


back to notes and tips index

Try my online puzzle page with Calcudoku, Killer Sudoku and online Sudoku.

make gmail notifier read out e-mail sender and subject

This is a (pretty ugly) hack specific to gnome-gmail-notifier on Linux.

It assumes you have festival (a Linux text-to-speech program) installed and running properly. So for example, running:
festival -b '(SayText "Hello there")'
produces the expected audio output.




Get the source tarball (tested to work with version 0.10.1), uncompress, and run ./configure. Install the appropriate *-devel packages that it complains about.

Next, edit the file src/ggn-manager.c: after line 342, which reads:
ggn_icon_show_notification (manager->priv->icon);
add these lines:

// bad hack to introduce pauses (the commas) and get rid of quotes char *msg_p = gsum->str; while(*msg_p != '\0') { if (*msg_p == ' ') *msg_p = ','; else if (*msg_p == 39) *msg_p = ','; else if (*msg_p == 34) *msg_p = ','; msg_p++; } if (strcmp(gsum->str, "(null)") == 0) { strcpy(gsum->str, "message,with,no,subject"); } char command_buffer[512]; sprintf(command_buffer, "/usr/bin/festival -b '(SayText \"%s, %s\")' &", gttl->str, gsum->str); // clear HTML tags char *lt_p; while(lt_p = strchr(command_buffer, '<')) { char *gt_p = strchr(command_buffer, '>'); char *i = lt_p; for(; i <= gt_p; i++) { *i = ' '; } } // while printf("Running command [%s]\n", command_buffer); system(command_buffer);
Next, in the directory which has configure, run (as root):
make install

Send yourself a test message, and start gnome-gmail-notifier
:-)


← back to notes and tips index
Please do not copy the text of this tip (© Patrick Min) to your web site.