private Set<File> findSettingsDirs(String appName, ApplicationLayout layout) {
		Set<File> discoveredDirs = new LinkedHashSet<>();
		appName = ApplicationUtilities.normalizeApplicationName(appName);
		String userNameAndAppName = SystemUtilities.getUserName() + "-" + appName;

		// Legacy default settings directory
		getDirFromProperty("user.home", "." + appName).ifPresent(dir -> {
			discoveredDirs.add(dir);
			discoveredDirs.addAll(getSubdirs(dir));
		});

		// Current default settings directory
		File settingsDir = layout.getUserSettingsDir();
		File settingsParentDir = settingsDir.getParentFile();
		if (settingsParentDir != null && (settingsParentDir.getName().equals(appName) ||
			settingsParentDir.getName().equals(userNameAndAppName))) {
			discoveredDirs.add(settingsParentDir);
			discoveredDirs.addAll(getSubdirs(settingsParentDir));
		}

		// Application system property override (likely not set for AppCleaner)
		getDirFromProperty(PROPERTY_SETTINGS_DIR, appName).ifPresent(dir -> {
			discoveredDirs.add(dir);
			discoveredDirs.addAll(getSubdirs(dir));
		});
		getDirFromProperty(PROPERTY_SETTINGS_DIR, userNameAndAppName).ifPresent(dir -> {
			discoveredDirs.add(dir);
			discoveredDirs.addAll(getSubdirs(dir));
		});

		// XDG environment variable override		
		getDirFromEnv(XDG_CONFIG_HOME, appName).ifPresent(dir -> {
			discoveredDirs.add(dir);
			discoveredDirs.addAll(getSubdirs(dir));
		});
		getDirFromEnv(XDG_CONFIG_HOME, userNameAndAppName).ifPresent(dir -> {
			discoveredDirs.add(dir);
			discoveredDirs.addAll(getSubdirs(dir));
		});

		return discoveredDirs;
	}
Finds user settings directories

@param appName The name of the application
@param layout The layout
@return A {@link Set} of discovered user settings directories, ordered such that
  parent directories are directly followed by their subdirectories, if applicable
@see ApplicationUtilities#getDefaultUserSettingsDir(ApplicationProperties, ResourceFile)
@see ApplicationUtilities#getLegacyUserSettingsDir(ApplicationProperties, ResourceFile)
Ghidra/Framework/Utility/src/main/java/utility/application/AppCleaner.java