Skip to content
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

Follow XDG Base Directory specification on Linux #11641

Closed
erlisdhima opened this issue Jul 31, 2021 · 2 comments
Closed

Follow XDG Base Directory specification on Linux #11641

erlisdhima opened this issue Jul 31, 2021 · 2 comments
Labels
Type: Duplicate Another item already exists for this topic

Comments

@erlisdhima
Copy link

By default the Arduino IDE creates a ~/.arduino15.

First issue, its on the $HOME dir. Ideally the XDG Base Directory specification must be used.
Second, the directory naming is specific to some version? Why not just .arduino ?

Finally, the files/directories inside it are all in one place.

$ ls ~/.arduino15
cache
library_index.json
library_index.json.sig
logs
package_index.json
package_index.json.sig
preferences.txt

As per the specification, this should be something like below...

Config files go into $XDG_CONFIG_HOME
From all the files, only preferences.txt has configs.

Cache files go into $XDG_CACHE_HOME
In this case it should be the cache directory.

actions history (logs, history, recently used files, …) go into $XDG_STATE_HOME
Here I'm assuming everything else from that directory are state files, and the logs directory, well, for logs.

@erlisdhima
Copy link
Author

I found its doing this for all platforms.

public File getSettingsFolder() throws Exception {
// otherwise make a .processing directory int the user's home dir
File home = new File(System.getProperty("user.home"));
File dataFolder = new File(home, ".arduino15");
return dataFolder;

Since java doesn't have a way to get the XDG dirs directly, I found this example https://github.com/omajid/xdg-java/blob/master/src/main/java/org/freedesktop/BaseDirectory.java

That does not include $XDG_STATE_HOME though, and it will need to be added.

@per1234
Copy link
Collaborator

per1234 commented Jul 31, 2021

Closing as duplicate of arduino/arduino-ide#1514

@per1234 per1234 closed this as completed Jul 31, 2021
@per1234 per1234 added the Type: Duplicate Another item already exists for this topic label Jul 31, 2021
@arduino arduino locked as too heated and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Duplicate Another item already exists for this topic
Projects
None yet
Development

No branches or pull requests

2 participants