From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aFdWOg5oK2KAgQAAgWs5BA (envelope-from ) for ; Fri, 11 Mar 2022 16:17:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mJLFNw5oK2JE5wAA9RJhRA (envelope-from ) for ; Fri, 11 Mar 2022 16:17:34 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8996E957C for ; Fri, 11 Mar 2022 16:17:34 +0100 (CET) Received: from localhost ([::1]:51786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSh1J-0006kh-QV for larch@yhetil.org; Fri, 11 Mar 2022 10:17:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSh0n-0006k0-I1 for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 10:17:03 -0500 Received: from ciao.gmane.io ([116.202.254.214]:45276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSh0l-0007RJ-1T for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 10:17:01 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nSh0h-0009Np-Vx for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 16:16:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH] org-protocol.org: updated Linux setup (Gnome) section Date: Fri, 11 Mar 2022 22:16:47 +0700 Message-ID: References: <20220310193517.ofifkwv2bmhmqpad@not-a-pinebook> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <20220310193517.ofifkwv2bmhmqpad@not-a-pinebook> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647011854; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fdyItifOxRLj8heArKI/yKS6vUXvkx9nBuozSfeLDUQ=; b=aMguRm7Y704wf/G2TKSa0mFN5OEMWbe9CuRNImf/gF8sQrSUFc+7LAcitTa5y1u7TswQw7 5GqG5VZOwzb+6XTsHsQF7dBM6QswVbxZrKgxo9ES82opEPVAPNEXqphZXVbYEaJWtcs2+w Lk9oN2k3rsI4nmoS1IER65Hn643oh1rP6MW+BZIwJHZGWMyNDcmcBZx+kQHNQBR9C4pp3q 13LQs4q6JO5UuHdL/yxYgw0LNjq+dlQywhWzIWOV1nuqvFSnhpl1iVEApgPt0+iFQs2iRq xpOWvex5xFPFrRGQAsy3osO51vWu5a5fGfXCoJUlE+tvGjH0FPSmWjTf8CBv7g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647011854; a=rsa-sha256; cv=none; b=qy6BZnQxxHVidPlm00mlXFK/SvdZYHmJscFvapKRBTQGfQfchOU6gxyFBEQ9G1d7jpDjNF txLQqHx5JwoHObsn54ioGQrGOc1uYIVfSZcVCIEPspAil6yURUlaqu+96K7g2j9gVeh7n1 wFTXeZvh2Q4XMWUeNyQqpMOGm69JRSnpRDRL1Eh3M4t/+JJTRrOtEZyb4iGWgoHRetQO03 8tjWU+fVNH/jCRnQ1xryj8ibwnIlSNKudWt1DBaPxilCspmr3cheg6LpQ7jKMgtQwD2GGc r44TivuIXEBSnLOW4H5FKrnRhhEUpKvFc0sYtXQPIUpDaVMyTGnV7d37sKzzpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.51 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8996E957C X-Spam-Score: 2.51 X-Migadu-Scanner: scn0.migadu.com X-TUID: UKUvC5/pef1a On 11/03/2022 02:35, Wilko Meyer wrote: > > I'd like to suggest an update to the org-protocol.org "Linux setup (Gnome)" > section as it is refering to gconf/gconftool-2 which is deprecated as of > Gnome 3. It may be a good idea to use .desktop-Files (as described in > freedesktop.orgs Desktop Entry/Menu Specification) here to complete this > step (which is what my patch suggests). Greet, definitely this page is severely outdated. I have a little experience with .desktop files so do not hesitate to object to my comments. > diff --git a/org-contrib/org-protocol.org b/org-contrib/org-protocol.org > index 57cab17f..b10ef41e 100644 > --- a/org-contrib/org-protocol.org > +++ b/org-contrib/org-protocol.org > @@ -89,10 +89,21 @@ actions. Just register your custom sub-protocol and handler with the variable > > *** Linux setup (Gnome) ^^^^^^^ It seems, the approach with the .desktop file works for KDE as well and even for minimal setup with simple window manager (no real desktop environment). What do you think concerning marking existing sections obsolete and adding new universal one for GNU/Linux? > - For this to work, you'll need the Gnome-Libraries to be installed. > + Add a file =org-protocol.desktop= to =~/.local/share/applications/=: > + > + #+begin_example > + [Desktop Entry] > + Name=org-protocol Since the entry may appear in UI (menu) I would consider adding "Comment" field as well to make it self-descriptive. For the same reason I would add "Icon=emacs" (it is unlikely that Org Mode icons are available in the system in all necessary sizes). I am unsure if "GenericName" and "Keywords" should be defined and what they may contain. > + Exec=emacsclient '%u' Accordingly to "Desktop Entry Specification" https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html > Field codes must not be used inside a quoted argument, the result of > field code expansion inside a quoted argument is undefined. The %F and > %U field codes may only be used as an argument on their own. For additional security I would add "--" separator to avoid treating passed argument as an option: Exec=emacsclient -- %u > + Type=Application > + Terminal=false > + Categories=System; I can not suggest a better category, e.g. Utility is hardly better that System, but it is not really a system application as well. Looking into http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/emacsclient.desktop I noticed StartupWMClass=Emacs that might give a hint when a new window is created. > + MimeType=x-scheme-handler/org-protocol; > + #+end_example > + > + Update the cache database of MIME types handled by desktop files via: > > - : gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command '/usr/local/bin/emacsclient %s' --type String > - : gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type Boolean true When I was setting org-protocol for the first time, I experienced various problems. I have seen various recipes, so I think it may be helpful to explicitly state that such commands are obsolete instead of removing them completely. The intention is to make users aware that such approach should not be tried even if they notice it on some other web site. I do not insist though. Side note: I believe, currently the best setup guide is https://github.com/sprig/org-capture-extension/ > + : update-desktop-database ~/.local/share/applications/ > > *** Linux setup (KDE) A note unrelated to your patch. With simple "emacsclient %u" handler a problem may happen when a browser is started from command line instead of clicking on the icon or from menu. If emacs has no frames then it may create a new one in the terminal instead of opening a graphical window (Emacs frame). Have you managed to adjust emacs server or general buffer settings to ensure new graphical frame (on the same virtual desktop) in such cases?