anyrun-org / anyrun

A wayland native, highly customizable runner.
GNU General Public License v3.0
560 stars 44 forks source link

applications: desktop entry specification fix #115

Closed peppidesu closed 6 months ago

peppidesu commented 7 months ago

This pull request solves #113

The application plugin is now compliant with the Desktop Entry Specification:

Desktop File ID

Each desktop entry representing an application is identified by its desktop file ID, which is based on its filename.

To determine the ID of a desktop file, make its full path relative to the $XDG_DATA_DIRS component in which the desktop file is installed, remove the "applications/" prefix, and turn '/' into '-'.

For example /usr/share/applications/foo/bar.desktop has the desktop file ID foo-bar.desktop.

If multiple files have the same desktop file ID, the first one in the $XDG_DATA_DIRS precedence order is used.

Before, desktop entries (not files, but the entries within each file) would be overridden if they had matching Name and Icon fields, and $XDG_DATA_DIRS precedence was disregarded completely. This meant that overriding the Name or Icon fields would be impossible, because it would simply appear as a second entry (not overriding the original one).

peppidesu commented 6 months ago

This PR has been created as well in https://github.com/anyrun-org/plugin-applications/pull/2, closing this PR.