function findBaseIconThemeDirPath() {
  const defaultBaseIconThemeDir = '/usr/share/icons/hicolor';
  const dataDirsString = process.env.XDG_DATA_DIRS;
  if (dataDirsString) {
    const dataDirs = dataDirsString.split(path.delimiter);
    if (dataDirs.includes('/usr/share/') || dataDirs.includes('/usr/share')) {
      return defaultBaseIconThemeDir;
    } else {
      return path.join(dataDirs[0], 'icons', 'hicolor');
    }
  } else {
    return defaultBaseIconThemeDir;
  }
}
Finds the path to the base directory of the icon default icon theme
This follows the freedesktop Icon Theme Specification:
https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#install_icons
and the XDG Base Directory Specification:
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables