use XDG base directory spec for desktop builds if supported #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds the usage of the XDG Base Directory Specification when referencing
tulip.root_dir()
from Tulip Desktop. This includes updating the Linux build script to use~/.local/share
instead of~/Documents
when referencing the desktop version of the root directory.XDG Base Directory Specification
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Testing
I have tested this change in a Fedora 38 environment, and the output of
tulip.root_dir()
shows the new root directory in~/.local/share/tulipcc
as expected.I also built this from source and flashed to my Tulip CC device, and did not find any problems with functionality. The output of
tulip.root_dir()
there was/
.macOS
I have not tested this for macOS. However, I noticed that version references
~/Documents
as well, so I provided fall back to that directory if~/.local/share
does not exist. It seems that~/Library
would be a better option instead of~/Documents
, so it may be a good idea to update that as well later.