Add support for XDG base directory spec #573
Open
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.
Currently, after opening the program, a directory named
.asyis created in the home directory, hosting configuration and state files.This request adds support for the XDG base directory spec https://wiki.archlinux.org/title/XDG_Base_Directory, which is a cross-platform specification that de-clutters the home directory and simplify backup management.
So, now instead of creating the
~/.asyfolder, the code checks if it exist and then uses it, fallbacking to the appropriate XDG directory.I took the liberty to simplify the code logic a bit, since there was also a possible bug in the code below, where the default options and current options were the same object, so the program wasn't actually reloading the settings when
setDefaultswas run.asymptote/GUI/xasyOptions.py
Lines 22 to 30 in 205a13c