From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id ED9AB6DE092F for ; Fri, 1 Nov 2019 18:01:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.19 X-Spam-Level: X-Spam-Status: No, score=-0.19 tagged_above=-999 required=5 tests=[AWL=0.011, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KRJxxI8vSdpz for ; Fri, 1 Nov 2019 18:01:56 -0700 (PDT) X-Greylist: delayed 394 seconds by postgrey-1.36 at arlo; Fri, 01 Nov 2019 18:01:56 PDT Received: from marcos.anarc.at (marcos.anarc.at [206.248.172.91]) by arlo.cworth.org (Postfix) with ESMTPS id 209E86DE022D for ; Fri, 1 Nov 2019 18:01:56 -0700 (PDT) Received: by marcos.anarc.at (Postfix, from userid 1000) id 176A310E086; Fri, 1 Nov 2019 20:55:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=orangeseeds.org; s=marcos; t=1572656120; bh=EsWixdxSiDpilJpyCcwDJMXV1FxJKw67pQB5TBWdhtk=; h=From:To:Subject:Date:From; b=I5LECiSzM441D6cGtM1+lBb5GWLoa7lG29rQRJRtRmc4LLmsyWOH8T6MQn7Q2iRfy LYyTyo+68fiZeDYiEwQ4BV7cViXMW4KYXof077oc4U+lKOKVhj9Vo/sOVNlsy4ErCb BZMD60MweH3UGFmbVdF3pdLRBfDh3m9sHZZ8qInvB/A0kMhs+al/u7hJL+URi/CxXw A6LpcZrRt7oMxfDKoWy9BIrZ6Fid60HZ0noRCRurFpki6iYAWWUAnSVumGKaudovOF IQIkp+wuQX2D0PVbzsQyirvat7NaBNpNiwVZs+1DjWmiX99cc6p7X4gwTf2PsZxH9C eA3Zrj++WVQ9g== Received: (nullmailer pid 30867 invoked by uid 1000); Sat, 02 Nov 2019 00:55:19 -0000 From: =?utf-8?Q?Antoine_Beaupr=C3=A9?= To: notmuch@notmuchmail.org Subject: RFC: desktop entry for xdg-email Date: Fri, 01 Nov 2019 20:55:19 -0400 Message-ID: <87imo33xmw.fsf@angela.anarc.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Nov 2019 01:01:58 -0000 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/notm= uch-emacs-mua.desktop [Desktop Entry] Categories=3DOffice;Network;Email; Comment=3DNotmuch mail Exec=3Dnotmuch-emacs-mua --client --create-frame --auto-daemon %u Name=3Dnotmuch-emacs-mua MimeType=3Dx-scheme-handler/mailto; Type=3DApplication 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=3Dnotmuch-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. :) --=20 Perl is "some assembly required". Python is "batteries included". PHP is "kitchen sink, but it=E2=80=99s from Canada and both faucets are labeled= C". - Alex Munroe, PHP: a fractal of bad design