How to make flatpak applications use standard locations for user data files?












1














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?










share|improve this question
























  • 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










  • 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
















1














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?










share|improve this question
























  • 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










  • 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














1












1








1







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?










share|improve this question















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?







xdg flatpak






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 3 '18 at 4:26

























asked Aug 2 '18 at 21:59









Alexey

5051720




5051720












  • 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










  • 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


















  • 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










  • 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
















Can you expand on what you're trying to do here? It's confusing.
– slm
Aug 3 '18 at 3:54




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






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




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












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






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




OK, so you want to override where Flatpak keeps its data.
– slm
Aug 3 '18 at 4:25










1 Answer
1






active

oldest

votes


















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"
],





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460187%2fhow-to-make-flatpak-applications-use-standard-locations-for-user-data-files%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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"
    ],





    share|improve this answer




























      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"
      ],





      share|improve this answer


























        0












        0








        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"
        ],





        share|improve this answer














        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"
        ],






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 20 '18 at 4:06

























        answered Dec 20 '18 at 3:55









        bscubed

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460187%2fhow-to-make-flatpak-applications-use-standard-locations-for-user-data-files%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre