-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set default data directory according to XDG directory specs and add archlinux installation instructions #22
Conversation
The script in this current version will try to put data under ~/spn-data With this change it will try to read XDG_DATA_HOME variable and if it cannot find the variable will default to $HOME/.local/share/
I primarily run this script on macOS, which doesn't support the XDG_DATA_HOME variable. I would prefer for the current default of $HOME/spn-data to be retained, in order to make the folder easier to find, rather than putting it in a hidden folder. This change would make the script unusable by default on macOS, since the parent folder needs to exist before |
This should fix it, I didn't think about macOS on the first commit :)
I don't think findability matters that much here, it's about not polluting the user space, which follows Apple's guidelines And under macOS it still is pretty findable, I think. Just 2 directories Current directory location is not just aesthetics either, it will cause problems to anyone using industry-standard backup practices
The default value used in case variable doesn't exist read raw and any special characters need to be escaped. Because it's a path anyway, probably wouldn't matter too much. If you want, you can delete it but here's what it looks like
If it's a modern system (after 2000s) 99.9999% it will exist. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html |
Anyway, as per your request I've made those modifications too, looking forward for your feedback :) |
Bash on macOS doesn't seem to ignore the backslashes. The below behavior occurs for me.
|
I'll merge the pull request once I'm done reviewing the code and testing on my own computer. |
The script in this current version will try to put data under ~/spn-data by default
With this change, however, it will try to read XDG_DATA_HOME variable and if it cannot find the variable will default to $HOME/.local/share/