4

Applications installed with Flatpak are keeping user data and configuration under ~/.var/app/ (see Wiki and documentation).

I would like the applications installed with Flatpak to reuse the configuration and data left from the system versions of the same applications. That is, I want them to keep user data in ~/.local/share, ~/.config, ~/.cache, instead of under ~/.var/app.

At first I was hoping that configuring environment variables XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME could suffice, or that it could be enough to start the application with --filesystem options:

 $ flatpak run --filesystem=xdg-config --filesystem=xdg-cache \
  --filesystem=xdg-data <application-id>

However, this did not seem to work.

What is the correct way to make Flatpak applications reuse user data and configurations in standard locations?

11
  • Can you expand on what you're trying to do here? It's confusing. – slm Aug 3 '18 at 3:54
  • Sorry,what is confusing? I want the applications like Skype or Lollypop that I install with Flatpak keep their data in the same locations in the user home folder where they would normally do when installed on Ubuntu with apt from some PPA. That way I would be able to easily replace a PPA version with Flatpak version and vice versa. – Alexey Aug 3 '18 at 4:18
  • Are you trying to get all of a specific user's apps to maintain it's data in ~/.var/app or do you want to share data across a given app to all users? – slm Aug 3 '18 at 4:19
  • 1
    I do not want Flatpak apps to keep their data in ~/.var/app, I want them to store it in ~/.local/share, ~/.config, ~/.cache. – Alexey Aug 3 '18 at 4:22
  • OK, so you want to override where Flatpak keeps its data. – slm Aug 3 '18 at 4:25
0

I was able to get this to work by specifying the directory after --filesystem=xdg-config and including mount parameters after that. I'm not sure if the mount parameters are necessary, but try putting this in this finish-args section of your application's manifest .json.

"finish-args": [
    "--filesystem=xdg-config/<config-dir>:create",
    "--filesystem=xdg-cache/<cache-dir>:create",
    "--filesystem=xdg-data/<data-dir>:create"
],

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.