1 import std.process : environment; 2 auto dataHomeGuard = EnvGuard("XDG_DATA_HOME", "/home/user/data"); 3 auto dataDirsGuard = EnvGuard("XDG_DATA_DIRS", "/usr/local/data:/usr/data"); 4 5 assert(applicationsPaths() == ["/home/user/data/applications", "/usr/local/data/applications", "/usr/data/applications"]);
ditto, but returns paths based on known data paths. This function is defined only on freedesktop systems to avoid confusion with other systems that have data paths not compatible with Desktop Entry Spec.