Desktop file ID or empty string if file does not have an ID. Note: This function retrieves applications paths each time it's called and therefore can impact performance. To avoid this issue use overload with argument.
import desktopfile.paths; string contents = "[Desktop Entry]\nType=Directory"; auto df = new DesktopFile(iniLikeStringReader(contents), "/home/user/data/applications/test/example.desktop"); auto dataHomeGuard = EnvGuard("XDG_DATA_HOME", "/home/user/data"); assert(df.id() == "test-example.desktop");
desktopfile.paths.applicationsPaths, desktopfile.utils.desktopId
See Desktop File ID