How should I handle two seemingly conflicting XDG Desktop Entry requirements?
3
votes
2
answers
677
views
According to my understanding of the [File Naming section](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html) in the XDG Desktop Entry Specification, I should name my
.desktop
file following reverse-DNS notation:
> The name of the desktop entry should follow the "reverse DNS" convention: it should start with a reversed DNS domain name controlled by the author of the application, in lower case. The domain name should be followed by the name of the application, which is conventionally written with words run together and initial capital letters (CamelCase). For example, if the owner of example.org writes "Foo Viewer", they might choose the name org.example.FooViewer, resulting in a file named org.example.FooViewer.desktop.
Naming the desktop file this way and placing it in XDG_DATA_HOME/applications
and then running xdg-desktop-menu forceupdate
afterwards does indeed result in my application showing up in all the usual places.. except for gnome. For some reason, my application won't show up in the "Recommended Applications", Gnome's equivalent to the "Open with.." in other File Managers/Desktop Environments.
The desktop is valid according to desktop-file-validate
.
After a quite a bit of digging, I came across recommendations to use another program, xdg-desktop-menu install
to validate the file. When I did, it produced the following error:
> xdg-desktop-menu: filename 'org.example.FooViewer.desktop' does not have a proper vendor prefix
A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated
with a dash ("-"). An example filename is 'example-org.example.FooViewer.desktop'
Use --novendor to override or 'xdg-desktop-menu --manual' for additional info.
When I tried this by removing the reverse DNS notation and just naming the file example-FooViewer.desktop
, it finally showed up in gnome.
Now I'm confused. Why is gnome breaking when I name my file according to the spec? Why does xdg-desktop-menu
deny processing this file despite it conforming to the spec? Why is gnome NOT breaking for other similarly-named desktop entry files - all Flatpaks show up in gnome's "open with" menu despite their desktop entries being named in reverse-DNS notation and most not containing vendor prefixes or so much as a single dash!
What is going on here? and how should I handle this conflict as an independent third-party packager? Am I missing something?
Asked by Tenders McChiken
(1319 rep)
Jan 15, 2023, 07:14 PM
Last activity: Jul 17, 2025, 05:34 PM
Last activity: Jul 17, 2025, 05:34 PM