Friday, April 03, 2009

Gmail as ubuntu preferred application

Hi guys,

I've just started playing with gnome-do.
The google-contacts plugin seems convenient, but it doesn't play well with my settings of ubuntu preferred application - configured for gmail.

I was using a solution found on Xantus blog :
perl -MURI::Escape -e '$to = shift;$to =~ s/^mailto://i;exec("firefox", "".URI::Escape::uri_escape($to) );' '%s'

but google-contacts was sending ///e@mail instead of mailto:e@mail, so I just added a second sed step :

perl -MURI::Escape -e '$to = shift;$to =~ s/^mailto://i;$to =~ s/^\/\/\///i;exec("firefox", "".URI::Escape::uri_escape($to) );' '%s'

Here is a test link.