[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: default email client from gsettings



On 04/05/2020 14:50, Simon McVittie wrote:
> Taking a step back from "tell me the default email client", what are
> you actually trying to do, at a high level? I suspect that rather
> than manipulating the default email client (which is a job for desktop
> configuration applications like gnome-control-center), you probably want
> to compose an email?

Yup.

> If your goal is to pre-fill the To/Subject/body of an email in the user's
> preferred email composition application, you would probably be better
> off building a mailto: URI and asking your preferred library (in your
> case that seems to be GLib/GTK?) to launch the preferred handler for that
> URI. In GLib/GTK, try using APIs like g_app_info_launch_default_for_uri().

Thanks for that. I'll take a look. Not sure how to call that from Perl,
yet, but I'll work it you.

> Or you could use xdg-email(1) from the xdg-utils package. It's a large
> shell script that tries to do various legacy desktop-specific and/or
> client-specific things in addition to the freedesktop.org URI-handler code
> path, so might work better in legacy environments, at the cost that if
> a desktop has moved from legacy desktop-specific APIs to freedesktop.org
> APIs and xdg-utils hasn't been updated, it will continue to do the legacy
> thing (even if that's now wrong).

That was my fallback, as when I first added the functionality, it didn't
always do the right thing. It looks as though it is much better, now.

Thanks again for the detailed explanation - and also to the others that
answered.

Regards

jeff

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: