Menu

#443 Add option to store the configuration in XDG_CONFIG_HOME

future
open
nobody
None
5
2024-11-19
2024-10-13
No

Fuse stores its configuration in $HOME/.fuserc, but Flatpak needs to store it in $XDG_CONFIG_HOME instead. This patch adds a configure setting to select that.

1 Attachments

Discussion

  • Sergio Baldoví

    Sergio Baldoví - 2024-10-19

    I'm up to allow the use of $XDG_CONFIG_HOME. Some modern applications use $HOME/.config for configuration files, with notable exceptions like OpenSSH [1].

    If $XDG_CONFIG_HOME is not set, the config file is stored in the working directory. Maybe we should check this case. The XDG Base Directory Specification [2] says:

    $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

    IMO we should also document this location in the manual.

    Opinions?

    [1] https://web.archive.org/web/20190925004614/https://bugzilla.mindrot.org/show_bug.cgi?id=2050
    [2] https://specifications.freedesktop.org/basedir-spec/latest/

     
    • Alberto Garcia

      Alberto Garcia - 2024-10-19

      Well, the patch was basically to merge upstream what I'm doing already in the Flatpak package, so it's not very sophisticated. Maybe I could have named it --enable-flatpak-build or something like that.

      Having proper XDG_CONFIG_HOME support would mean that the configuration file goes inside a subdirectory, something like this:

      • $XDG_CONFIG_HOME/fuse-emulator/fuserc
      • $XDG_CONFIG_HOME/fuse/fuserc
      • $XDG_CONFIG_HOME/fuse-emulator/config
      • $XDG_CONFIG_HOME/fuse/config

      Existing packages for Linux distros won't probably change the default location because we have been using ~/.fuserc for ages, so I'm not sure how many users would enable this (although we could rename the old config file to the new one automatically, that would be an option).

       
      • Arki55

        Arki55 - 2024-11-18

        Ad to proposed..

         --enable-flatpak-build
        

        Is building a flatpack package only about the location of config file? Having built in support to build a flatpack in FUSE base repo would be great, it would allow me to automate nightly build for linux too ( currently possible only for windows ).

         
  • Alberto Garcia

    Alberto Garcia - 2024-10-25

    A related idea (just mentioned in the mailing list) is to have a way to specify the path of the configuration file at runtime. An environment variable (FUSE_EMULATOR_CONFIG) would be the easiest, but a command-line option would also work.

     
    • Alberto Garcia

      Alberto Garcia - 2024-11-02

      Adding the FUSE_EMULATOR_CONFIG environment variable should be as simple as this.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.