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.
1 import desktopfile.paths; 2 3 string contents = "[Desktop Entry]\nType=Directory"; 4 auto df = new DesktopFile(iniLikeStringReader(contents), "/home/user/data/applications/test/example.desktop"); 5 auto dataHomeGuard = EnvGuard("XDG_DATA_HOME", "/home/user/data"); 6 assert(df.id() == "test-example.desktop");
desktopfile.paths.applicationsPaths, desktopfile.utils.desktopId
See Desktop File ID