Question about the recommended XDG subfolders usage in Flatpak

Hello,

I’m testing packaging applications with Flatpak and I’m having questions regarding the usage of XDG folders.

It is an application that is currently using the /app path for some read-write files so I’m patching it so that it uses the Flatpak XDG folders for those.

Since these changes are only for Flatpak packaging, I’m having questions whether is best to use the typical behaviour (XDG_CONFIG_HOME/APP_NAME/CFG_FILE) or a simplified one (XDG_CONFIG_HOME/CFG_FILE).

Examples of possible options:

  1. ~/.var/app/org.apache.jmeter/config/user.properties
  2. ~/.var/app/org.apache.jmeter/config/jmeter/user.properties
  3. ~/.var/app/org.apache.jmeter/config/org.apache.jmeter/user.properties

I’m not sure which option would be the recommended for this packaging.

For further information about the tests I’m doing, those are jmeter and soapui.

Don’t put files directly under XDG_CONFIG_HOME, as it will force the user giving access to the host’s XDG_CONFIG_HOME instead of just giving access to the specific settings folder with --filesystem=xdg-config/jmeter.
For example, the user might want to do this to be to share the Flatpak app config with the host app, or if the user prefers having application config under the host XDG_CONFIG_HOME for visibility and simpler settings backup.

I have no strong opinion about using the full app ID in the folder name, though it will stand out in the host XDG_CONFIG_HOME.

Whatever you decide, I think it should be the same for Flatpak and system installations, so the user will have the choice to use the same config for both by adding a filesystem override.

1 Like