Skip to content

Conversation

@jrom99
Copy link

@jrom99 jrom99 commented Sep 27, 2025

Currently, after opening the program, a directory named .asy is 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 ~/.asy folder, 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 setDefaults was run.

def defaultOptions(self):
if self._defaultOptions is None:
f = io.open(self._defaultOptLocation)
try:
opt = cson.loads(f.read())
finally:
f.close()
self._defaultOptions = opt
return self._defaultOptions

Currently, after opening the program, a directory named `.asy` is 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 `~/.asy` folder, 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 `setDefaults` was run.

https://github.com/vectorgraphics/asymptote/blob/205a13c2bfdd5f6d0e61157e09d02f1506ed2cb4/GUI/xasyOptions.py#L22-L30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant