In my previous article Print XDG Desktop Definition for Application i described a way to search the various „applications“ sub-directories of the known XDG data directories for .desktop-files that match certain search criteria.
The short shell script from that article is now available as a commandline utility, including the usual bells and whistles such as option parsing and a manpage. Also, it now supports more exact control over which directives in the desktop files are searched and which are displayed in the search results.
Here is an example searching for any desktop files containing „firefox“ in their „Name“or „Exec“ directives, displaying the „Name“, „Comment“ and „Exec“ directories of each result:
xdg-desktop-search -v -s Exec -s Name -d Name -d Comment -d Exec firefox
The utility is available here:
Gitea project xdg-desktop-searchLast 3 commits: by tilman: aff332d5 change exit codes by Tilman Kranz: 0eb7823f fix some warnings if searchdirs are missing by tilman: f7f760cb Update xdg-desktop-search