private static void updateMimeTypes(List<MimeTypeDescription> descriptions) throws OSFileAssociationException {
    try {
      var mimeFile = Path.of(SystemProperties.getUserHome(), LOCAL_MIME_PACKAGES_PATH, EXTENSIONS_FILE_NAME);
      Files.createDirectories(mimeFile.getParent());
      JDOMUtil.writeDocument(createMimeFile(descriptions), mimeFile, "\n");

      var mimeDir = Path.of(SystemProperties.getUserHome(), LOCAL_MIME_DIR);
      runCommand(new GeneralCommandLine("xdg-mime", "install", "--mode", "user", "--novendor", mimeDir.toString()));

      var desktopEntryName = CreateDesktopEntryAction.getDesktopEntryName();
      CreateDesktopEntryAction.createDesktopEntry(false);

      @SuppressWarnings("SSBasedInspection") var mimeTypes = descriptions.stream().map(mtd -> mtd.type).toList();
      runCommand(new GeneralCommandLine("xdg-mime", "default", desktopEntryName).withParameters(mimeTypes));

      var appDir = Path.of(SystemProperties.getUserHome(), LOCAL_APP_DIR);
      runCommand(new GeneralCommandLine("update-desktop-database", appDir.toString()));
    }
    catch (Exception e) {
      throw new OSFileAssociationException(e);
    }
  }
private static void updateMimeTypes(List<MimeTypeDescription> descriptions)