1

How to set chromes gmail shortcut, or any other app.desktop, as default email client? It does not show up in the settings section for default applications. All i see there are geary and gnome-gmail.

0

You can set your gmail to open all email links in two ways:

Easy Way

If you sign in to your gmail account from google chrome, you should see an 'eye' icon that says that the site wants to install a service handler. Click on it and then allow and click done. Now, whenever you click an email, it will open in your gmail.

Hard way

  1. Open your favorite text editor and add the following lines to it:

    #!/bin/sh
    firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’
    

save it as open_gmail.sh (or whatever you like)

  1. Type in terminal the following command by giving the exact path of open_gmail.sh file:

chmod u+x /path/to/open_gmail.sh

  1. Now I assuge thunderbird is your default client. I will edit thunderbird.desktop file in this example. First just back-up that file by:

cp /usr/share/applications/thunderbird.desktop path/to/where/you/want_to_save

  1. Now open thunderbird.desktop by:

sudo nano /usr/share/applications/thunderbird.desktop

and find the line that says Exec=thunderbird %u

  1. and make it look like:

Exec=/path/to/open_gmail.sh %u

Save and exit.

  1. Run sudo update-desktop-database

Now whenever you click an email address, it will open in gmail in firefox. If you are not signed-in to gmail, it will first ask you to sign-in.

If you want to revert this, replace the edited /usr/share/applications/thunderbird.desktop with the backup of the original usr/share/applications/thunderbird.desktop file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.