tools icon indicating copy to clipboard operation
tools copied to clipboard

feat: use XDG directories on Linux

Open flexagoon opened this issue 1 year ago • 4 comments

This removes the need for the ~/.dart_tool directory in user's HOME. It moves the config file to $XDG_CONFIG_HOME/dart_tool, and all other data to $XDG_DATA_HOME/dart_tool. If the old directory exists but the new one doesn't, the old location is used as a fallback. Otherwise, the new directories are created.

See https://github.com/dart-lang/sdk/issues/41560 (this doesn't fully solve the issue, but it does get rid of one of the offending directories)


  • [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

flexagoon avatar Nov 03 '24 23:11 flexagoon

thanks for this PR! I was thinking that we could add some utilities for this to the cli_util package and then use them across any dart programs. What do you think? See dart-archive/cli_util#94

4e554c4c avatar Nov 06 '24 15:11 4e554c4c

can you make sure this also applies to macos?

pauliesnug avatar Nov 17 '24 18:11 pauliesnug

@jonasfj Would this be merged?

aaravrav avatar Jan 18 '25 09:01 aaravrav

does this need anything to work? (to be merged)

misterhackerman avatar Mar 22 '25 09:03 misterhackerman

/cc @srawlins @bkonyi

aaravrav avatar Aug 01 '25 05:08 aaravrav

CC @bwilkerson . I'm not sure who maintains unified_analytics these days.

srawlins avatar Aug 03 '25 14:08 srawlins

CC @bwilkerson . I'm not sure who maintains unified_analytics these days.

The Dash Developer Services team does, although there hasn't really been any active work in this area for awhile.

We're actively deciding where we want all of the Dart / Flutter tools to write state in https://github.com/dart-lang/sdk/issues/41560, but I don't think we're going to move forward with this PR at this time (please see the discussion in the linked issue).

bkonyi avatar Aug 05 '25 14:08 bkonyi