unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Antoine Beaupré" <anarcat@orangeseeds.org>
To: notmuch@notmuchmail.org
Subject: RFC: desktop entry for xdg-email
Date: Fri, 01 Nov 2019 20:55:19 -0400	[thread overview]
Message-ID: <87imo33xmw.fsf@angela.anarc.at> (raw)

On my system, if I click on mailto: links in my web browser (yes, those
still exist), Thunderbird starts up. Oh the horror!

Wouldn't it be nice if notmuch-emacs-mua would start instead?

Worry not my notmuch friends! I have a solution for you!11!!!

First, you need to drop something like this in /usr/share/applications/notmuch-emacs-mua.desktop

[Desktop Entry]
Categories=Office;Network;Email;
Comment=Notmuch mail
Exec=notmuch-emacs-mua --client --create-frame --auto-daemon %u
Name=notmuch-emacs-mua
MimeType=x-scheme-handler/mailto;
Type=Application

Liberally inspired by mutt.desktop and probably horribly wrong in many
ways:

 * missing an icon (do we ship one of those?)
 * doesn't handle message/rfc822something (a job for
   notmuch-slurp-something?)
 * might hurt your cat (poor tokenized thing)
 * do you like .INI files? me neither!
 * what the heck is that thing anyways and how do I include that in a
   Debian package?

I know right? It's great. Once you have figured out all that good stuff,
the next step is to hook that up in your web browser. You will be happy
to know there is a "standard" (as in "it starts with X so it *must* be
cool because mutants are cool") that defines how that work, from the
"Cross Desktop Group"

https://specifications.freedesktop.org/mime-apps-spec/latest/index.html

(The "Cross" in this context probably refers to:

     11. Hence: A mixing of breeds or stock, especially in cattle
         breeding; or the product of such intermixture; a hybrid
         of any kind.

... and obviously not:

     1. A gibbet, consisting of two pieces of timber placed
        transversely upon one another, in various forms, as a T,
        or +, with the horizontal piece below the upper end of the
        upright, or as an X. It was anciently used in the
        execution of criminals.

... and probably not:

     3. Affiction regarded as a test of patience or virtue; trial;
        disappointment; opposition; misfortune.

... anyways, I disgress.)

Apparently, to figure out the current setting, you (obviously) will need
to run something like this:

    xdg-mime query default x-scheme-handler/mailto

It will probably not show you notmuch. Sad face. At that point, you will
probably launch whatever control panel, dashboard, settings app,
resource editor, or whatever that thing is called these days, and set
your prefered app. If you are an old obstinate grumpy graybeard like me
that refuse any sort of progress and is stuck in a mostly black and
white "GUI" full of text that no one understands, you know everyone
fundamentally hates each other and the world is pain, so *obviously* you
will need to edit another text file to make the above behave.

So head over your favorite text editor (let's not discuss that further
shall we) to .config/mimeapps.list and add a line like this:

    x-scheme-handler/mailto=notmuch-emacs-mua.desktop

You'll note the file probably already exists if you use any modern web
browser because those folks *love* to fight with each other (told you,
hate, hate everywhere) for supremacy over that file. Just add that line
somewhere meaningful until `xdg-email` and the above `xdg-mime` query
works correctly.

Then you can thank me the next (last?) time you ever encounter a mailto:
link. It's going to be a funny surprise!

Oh, and the next time you find a contact form to send email, just fax
bomb it or something.

Have a good weekend.

A.

PS: I tried to make this one entertaining, sorry if it's a bit long or
offensive to some, let me know if I went too far. :)

-- 
Perl is "some assembly required". Python is "batteries included". PHP
is "kitchen sink, but it’s from Canada and both faucets are labeled C".
                         - Alex Munroe, PHP: a fractal of bad design

             reply	other threads:[~2019-11-02  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02  0:55 Antoine Beaupré [this message]
2019-11-02  2:49 ` RFC: desktop entry for xdg-email Daniel Kahn Gillmor
2019-11-02 14:37 ` Jorge P. de Morais Neto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imo33xmw.fsf@angela.anarc.at \
    --to=anarcat@orangeseeds.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).