Results 1 to 5 of 5

Thread: Chrome GMail Webapp as Default Email Client

  1. #1
    Join Date
    Jun 2009
    Location
    USA
    Beans
    47
    Distro
    Ubuntu 10.04 Lucid Lynx

    Chrome GMail Webapp as Default Email Client

    Many of you probably already know this, but the Gmail web Client can be set as the default Email client using Prism or Chrome. All you have to do is create a script file in your home directory and place this into there. (this is for Chrome by the way)

    Code:
    #!/bin/sh
    
    /opt/google/chrome/google-chrome --app="https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
    Make the script executable, (right click on file-->Properties-->Permissions-->check box or navigate to directory and chmod +x the file)

    This is great, however, I noticed that when you add that script as the default mail client, gm-notify insist on bringing you to the compose message dialog(when gm-notify is set to open the current mail client) instead of the inbox, so i changed your script to weed that little bug out!

    Code:
    #!/bin/sh
    if ($1 > /dev/null); then
    /opt/google/chrome/google-chrome --app="https://mail.google.com/mail/?hl=en&shva=1"
    else
    /opt/google/chrome/google-chrome --app="https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
    fi
    So now we have the best of both worlds, opening from gm-notify gives me the inbox, while clicking on an email address gives me the compose message dialog.

    Thanks to this video for the idea: http://www.youtube.com/watch?v=WGv9kwwya-w

    I hope this helps someone! Also, the script can easily be rewritten for Firefox.

    Code:
    #!/bin/sh
    if ($1 > /dev/null); then
    firefox "https://mail.google.com/mail/?hl=en&shva=1"
    else
    firefox "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
    fi
    Please give any corrections to the script if needed. Thanks!

  2. #2
    Join Date
    Dec 2008
    Location
    Cleveland, OH, USA
    Beans
    489
    Distro
    Ubuntu Studio Development Release

    Re: Chrome GMail Webapp as Default Email Client

    Cool idea...see if you can get this moved over to the tutorials section

  3. #3
    Join Date
    Jun 2009
    Location
    USA
    Beans
    47
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Chrome GMail Webapp as Default Email Client

    I do not want to create a duplicate thread, how do i submit this one to tutorials and tips, sorry for the noob question?

    * Update *

    Never-mind i submitted the post again, now just have to wait and see!
    Last edited by megamanexent; May 20th, 2010 at 01:51 AM. Reason: Update

  4. #4
    Join Date
    Mar 2011
    Beans
    1

    Re: Chrome GMail Webapp as Default Email Client

    Hey, thanks for the great script - one suggestion though, the way you check for an empty string will try to execute the argument, so if you would try and send an email to 'rm -rf /home/youruser' or something like that... Well, just check like this instead:
    Code:
    if [ -z $1 ]; then

  5. #5
    Join Date
    Jun 2009
    Location
    USA
    Beans
    47
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Chrome GMail Webapp as Default Email Client

    Quote Originally Posted by c089 View Post
    Hey, thanks for the great script - one suggestion though, the way you check for an empty string will try to execute the argument, so if you would try and send an email to 'rm -rf /home/youruser' or something like that... Well, just check like this instead:
    Code:
    if [ -z $1 ]; then

    Woahh, Thank you. Major flaw
    I also will have to change this thread to!!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •