Google Mail as default mail client
How to use Google Mail's web interface as your default mail client
This is mainly for my dad who hasn't worked out how to stop Evolution from starting every time he clicks a mailto: link and uses Google mail. So here's how to use Google Mail's web interface as your default mail client.
First of all create a empty text file called gmail_compose in your home folder (or wherever), make it executable, and then copy and paste the following into it…
#!/usr/bin/env bash
uri=$( echo "$1" | sed -e "s/subject=/su=/" -e "s/^mailto:\([^&?]\+\)[?&]\?\(.*\)$/\1\&\2/" )
firefox "https://mail.google.com/mail?view=cm&tf=0&to=${uri}"
Of course you can substitute Firefox for whatever browser you use. Or, if multiple users have access to the script, try xdg-open.
Then set this script as your default mail client for whatever desktop you're using. For example in Gnome go to System > Preferences > Preferred Applications, and then in the "Mail Reader" section select Custom from the drop down box and in the "Command" box put /location/to/gmail_compose %s, e.g. /home/<username>/gmail_compose %s.

