ensemblesaw / ensembles-app

A digital arranger workstation powered by FluidSynth
323 stars 9 forks source link

Follow XDG Base Directory Specification #71

Closed flxzt closed 2 years ago

flxzt commented 2 years ago

Currently ensembles is creating ~/Documents/Ensembles for its configuration files. I think it should follow the XDG spec and place its configuration wherever XDG_CONFIG_HOME is pointing to.

Glib even has the function get_user_config_dir for retreiving the path.

SubhadeepJasu commented 2 years ago

It doesn't store configurations there. That folder stores user files like styles, recordings, display themes, etc.

flxzt commented 2 years ago

then maybe XDG_DATA_HOME or XDG_DOCUMENTS_DIR ?

SubhadeepJasu commented 2 years ago

yeah that I should do, unless its already like that in the code. Also just found that, it also stores input presets which are configuration files, which I will definitely store in XDG_CONFIG_HOME. Thanks for bringing it up.

SubhadeepJasu commented 2 years ago

Slight change: I can't use XDG_DATA_HOME because that's for user data which is analogous to installed data in /usr/share. Also I don't see anything like XDG_DOCUMENT_DIR in the XDG Base Directory specification. I will remove the document part from the path, so its just HOME. Configs will be stored in a subdirectory under XDG_CONFIG_HOME.

flxzt commented 2 years ago

There is though, its not in the linked spec for the base-dirs, but there is this which specifies exactly what you want, "XDG_DOCUMENT_DIR", and is used by all main distributions.

(Or, personally I would prefer making the save directory configurable from within the application.)

SubhadeepJasu commented 2 years ago

That's planned as well. I am just setting something as default for now.

flxzt commented 2 years ago

Ok, sounds good :) This would be the glib function for easy retreival of the dir: https://docs.gtk.org/glib/func.get_user_special_dir.html

SubhadeepJasu commented 2 years ago

That did it. Thanks for the help :)

SubhadeepJasu commented 2 years ago

Screenshot from 2022-03-20 12-28-07 Screenshot from 2022-03-20 12-29-36