From 1a5fff01aff34ea95531b4fb75a1bfd34808228c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 11 Oct 2017 11:16:20 +0100 Subject: [PATCH 4/4] desktop-entry-spec: Deprecate dashes in well-known names We don't really need two parallel forms of punctuation, and in particular DNS domain names only have one (dashes). If we choose one representation and deprecate the other, it makes the recommendation clearer for app authors. Dashes are not allowed in D-Bus object paths and interface names, are only conditionally allowed in Flatpak app IDs (they can only appear in the last element), and have a special syntactic role in Freedesktop icon names. An alternative approach would be to allow dashes, deprecate underscores, have a trivial conversion from DNS domain name to desktop file ID (except in the case of leading digits), and always special-case the transformation from desktop file ID/well-known bus name to object path, interface name or Flatpak app ID. However, that seems more error-prone, because it would make naive code incorrect; and general-purpose conversion from DNS domain name to desktop file ID is always going to need a special case anyway, to deal with leading digits (allowed in DNS but not D-Bus). Signed-off-by: Simon McVittie --- desktop-entry/desktop-entry-spec.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/desktop-entry/desktop-entry-spec.xml b/desktop-entry/desktop-entry-spec.xml index 63c4a70..5924a42 100644 --- a/desktop-entry/desktop-entry-spec.xml +++ b/desktop-entry/desktop-entry-spec.xml @@ -118,6 +118,21 @@ the name org.example.FooViewer, resulting in a file named org.example.FooViewer.desktop. + + Well-known names containing the dash are allowed but not recommended, + because the dash is not allowed in some related uses of reversed + DNS names, such as D-Bus object paths and interface names, and Flatpak + app IDs. If the author's domain name contains a dash, replacing it + with an underscore is recommended: this cannot cause ambiguity, + because underscores are not allowed in DNS domain names. + + + If the author's domain name contains a label starting with a digit, + (which is not allowed in D-Bus well-known names), prepending an + underscore to that element of the desktop entry name is recommended. + For example, 7-zip.org might release an application named + org._7_zip.Archiver. + Desktop File ID -- 2.15.0.rc0