Skip to content

finders/desktop: get file locations from environment, check subdirectories and do not cache duplicate desktop file ids - #37

Merged
vaxerski merged 4 commits into
hyprwm:mainfrom
TheTrueWhiteOwl:dedup-desktop-ids
Nov 15, 2025
Merged

finders/desktop: get file locations from environment, check subdirectories and do not cache duplicate desktop file ids#37
vaxerski merged 4 commits into
hyprwm:mainfrom
TheTrueWhiteOwl:dedup-desktop-ids

Conversation

@TheTrueWhiteOwl

Copy link
Copy Markdown
Contributor

Get .desktop files from $XDG_DATA_HOME/applications (default to $HOME/.local/share/applications) followed by $XDG_DATA_DIRS/applications (default to /usr/local/share/applications followed by /usr/share/applications). Order is important!

Get .desktop files from subdirectories of the ones mentioned above

Each .desktop file has a desktop file id (path relative to applications directory, with "/" replaced by "-"), only first .desktop file with a specific id found is used (hence why the order above matters). This allows users to locally override system .desktop files.
e.g. if there is a ~/.local/share/applications/steam.desktop and /usr/share/applications/steam.desktop they both have the same id so the first one will be used rather than the second one

@TheTrueWhiteOwl TheTrueWhiteOwl changed the title Improve freedesktop.org desktop-entry specification compliance finders/desktop: get file locations from environment, check subdirectories and do not cache duplicate desktop file ids Nov 9, 2025
Comment thread src/finders/desktop/DesktopFinder.cpp Outdated
@TheTrueWhiteOwl

This comment was marked as resolved.

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@vaxerski
vaxerski merged commit 2ab1364 into hyprwm:main Nov 15, 2025
1 check passed
@TheTrueWhiteOwl
TheTrueWhiteOwl deleted the dedup-desktop-ids branch December 6, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants