How do I set the default email client in LXQt?

I could not find the default email client setting here: Preferences >LXQt Settings > Session Settings > Default Applications. Only choices for Terminal Emulation and Web Browser are there. The default email client is Trojita and I want MailTo: to take me to Claws Mail.

Besides the Default Applications app, defaults can also be set in the Alternatives Configurator (G Alternatives). No generic label is shown for an email client. I believe it would be called, "x-email-client" According to ,

An exec with the generic name is generally put in /usr/bin, for example, /usr/bin/x-terminal-emulator. Also, each installed generic app should have a text file in /var/lib/dpkg/alternatives/, which will list the alternatives for that app. The actual script linking the generic app to the real apps (alternatives) is contained in a file in /etc/alternatives/. So look in either of these directories to see the names of the generic programs already installed and look in the first one to find out the alternatives in each.

5

1 Answer

The Solution

xdg-settings

The solution is defining which program to call for a given URL scheme with xdg-settings from the xdg-utils package:

xdg-settings set default-url-scheme-handler mailto claws-mail.desktop`

You can also use this to work with any URL scheme possible. Just make sure that for whatever program you want to use, it has a Desktop Entry file, as suggested by the final argument (since it's claws-mail.desktop and not claws-mail).

MIME types

Another similar but unrelated thing is media types, or MIME types. These are not about URL schemes like mailto: but about the type of content or format a particular file has.

For example, a JPEG image would be image/jpeg. With various tools that manipulate MIME type associations, you could change which program opens such a file.

Despite this difference between MIME types and URL schemes, the XDG Specification does allow for a special x-scheme-handler MIME type. It appears this was added after GNOME started using them.

Technically, this is what the above command makes use of, altering your $HOME/.config/mimeapps.list file to add the following:

[Default Applications]
x-scheme-handler/mailto=claws-mail.desktop

Note there's a global configuration at /etc/xdg/xdg-Lubuntu/mimeapps.list, but the local one overrides it.

one other thing

Firefox defines its own URL handlers, so it may be necessary to also make a change there if that is a browser you use, as explained in this answer.


Not The Solution

alternatives system

Using the alternatives system, whether by GUI or update-alternatives won't do what you want, as its purpose is to redefine general symbolic links. For example, there's a x-www-browser that could theoretically be defined to any number of browsers.

If there was something like x-email-client, you could theoretically use the above solution to set the default handler to it and then you could swap email clients out through the alternatives system. Unfortunately, there isn't an x-email-client or anything like it, just the likes of mailx for use on the command line.

LXQt default applications

You know this already, but this doesn't work. The reason for the small list is that these only change the values of environment variables, of which only a small handful are supported at all.

Sadly, these are not particularly reliable ways of even setting the default browser, as evidenced by this task Lubuntu is tracking.

GUI

At time of writing, I can't find a general GUI front end to accomplish this particular task. There are some that work with MIME types, but not the URL scheme handlers.

Some desktop environments may implement some sort of GUI for this within the context of their desktop environment. KDE does this and you can see it in Kubuntu, but it's hard to pull that particular feature outside of the context of the KDE environment.

LXQt does have lxqt-config-file-associations but it has several issues, including that you cannot add or remove new entries and x-scheme-handler types are not supported, although the fix for that latter issue appears to be in 0.16.0 which should find its way in Hirsute Hippo.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like