Comment 2 for bug 1063801

Revision history for this message
Ongytenes (ongytenes) wrote :

I found that if I ran xdg-email from the command line, it would load Chromium instead of Thunderbird. I checked xdg-mime and saw that Thunderbird was my default mail client.

I then looked at the xdg-email script and determined that the script only has code to recognize common desktops like KDE and Gnome. It does this by looking at the environment variables by using the following script. The mail client usage is influenced by what desktop is being used.

detectDE()
{
    if [ x"$MAILER" != x"" ]; then DE=envvar;
    elif [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
    elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
    elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde;
    elif [ x"$XDG_CURRENT_DESKTOP" = x"LXDE" ]; then DE=lxde;
    elif [ -r ~/.muttrc ] && which mutt > /dev/null 2>&1; then
 DE=envvar
 MAILER="x-terminal-emulator -e mutt"
    else DE=""
    fi
    DEBUG 2 "DE is \"$DE\""
}

So I did an experiment, I added the following one line to xdg-email.
    elif [ x"MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;

First I ran xdg-email with an email address from the command line and Thunderbird was loaded with the address.
Then I tried clicking a link in Chrome and it opened Thunderbird with the address.

I believe a better fix would involve writing a whole procedure just for Mate in the xdg-email instead of pointing it to the gnome procedure.