Store configuration and persistent application data separately, in the user-defined directories defined by the ${XDG_*_HOME} environment variables
In configuring the client, I couldn't help but groan when I saw yet another new hidden directory in my ${HOME} directory. Like many long-time users of UNIX-like operating systems, the amount of time it takes to scroll from one end of ${HOME} to the other is perhaps the most omnipresent reminder (and penultimately insufferable, after joint pains) of how far removed I've become from the young man I still expect to gaze back at me from the mirror. Freedesktop.org, bless their hearts, offers a relatively simple and widely-adopted solution in the form of the XDG Base Directory Specification and it would be lovely if the client were to be compliant with it. I've summarized the behavior changes I believe would be necessary to arrive at that result, in case someone else who agrees with the proposed changes and has more free time wants to mockup a PR to this effect.
Store submissions database file submissions.sqlite in ${XDG_DATA_HOME}/abz or elsewhere as defined in abzsubmit.conf instead of at ${HOME}/.abzsubmit/filelog.sqlite. If either the file or directory do not exist, attempt to create them automatically with octal permissions of 0700 and 0755, respectively. If the ${XDG_DATA_HOME} environment variable is unset, fallback to using ${HOME}/.local/share/abz as the persistent data directory.
https://github.com/MTG/acousticbrainz-client/blob/d370a46e8a12bfaaba3857d2c2035a82ef35b16e/abz/config.py#L79-L90
Proposal:
Store configuration and persistent application data separately, in the user-defined directories defined by the ${XDG_*_HOME} environment variables
In configuring the client, I couldn't help but groan when I saw yet another new hidden directory in my ${HOME} directory. Like many long-time users of UNIX-like operating systems, the amount of time it takes to scroll from one end of ${HOME} to the other is perhaps the most omnipresent reminder (and penultimately insufferable, after joint pains) of how far removed I've become from the young man I still expect to gaze back at me from the mirror. Freedesktop.org, bless their hearts, offers a relatively simple and widely-adopted solution in the form of the XDG Base Directory Specification and it would be lovely if the client were to be compliant with it. I've summarized the behavior changes I believe would be necessary to arrive at that result, in case someone else who agrees with the proposed changes and has more free time wants to mockup a PR to this effect.
Behavior changes:
Switch from using a single directory for application files at
${HOME}/.abzsubmit
to two directories for configuration/profiles and persistent activity logs respectively, both with fallback filepaths located a minimum of one nested level beneath${HOME}
. https://github.com/MTG/acousticbrainz-client/blob/d370a46e8a12bfaaba3857d2c2035a82ef35b16e/abz/config.py#L74-L76Look for user configuration file
abzsubmit.conf
and defaults filedefault.conf
in${XDG_CONFIG_HOME}/abz
instead of at${HOME}/.abzsubmit/abzsubmit.conf
. If either the files or directory do not exist, attempt to create them automatically with octal permissions of 0700 and 0755, respectively. If the${XDG_CONFIG_HOME}
environment variable is unset, fallback to using${HOME}/.config/abz
as the configuration directory. https://github.com/MTG/acousticbrainz-client/blob/d370a46e8a12bfaaba3857d2c2035a82ef35b16e/abz/config.py#L19 https://github.com/MTG/acousticbrainz-client/blob/d370a46e8a12bfaaba3857d2c2035a82ef35b16e/abz/config.py#L95Store submissions database file
submissions.sqlite
in${XDG_DATA_HOME}/abz
or elsewhere as defined inabzsubmit.conf
instead of at${HOME}/.abzsubmit/filelog.sqlite
. If either the file or directory do not exist, attempt to create them automatically with octal permissions of 0700 and 0755, respectively. If the${XDG_DATA_HOME}
environment variable is unset, fallback to using${HOME}/.local/share/abz
as the persistent data directory. https://github.com/MTG/acousticbrainz-client/blob/d370a46e8a12bfaaba3857d2c2035a82ef35b16e/abz/config.py#L79-L90