Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Store cached data in XDG-defined paths, not ~/.clippy #29

Open
Daenyth opened this issue Dec 19, 2016 · 5 comments
Open

Store cached data in XDG-defined paths, not ~/.clippy #29

Daenyth opened this issue Dec 19, 2016 · 5 comments

Comments

@Daenyth
Copy link

Daenyth commented Dec 19, 2016

A lot of linux users really dislike random apps cluttering ~/.foo directories; It's recommended to use XDG paths instead.

https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Clippy would use $XDG_CACHE_HOME/clippy, defaulting to ~/.cache/clippy/

@adamw
Copy link
Member

adamw commented Dec 20, 2016

Didn't know about that, thanks :) I suppose ~/.cache/clippy would be a good default for macos too.

You don't know what's the convention on windows, by chance?

And maybe you'd like to try a PR? This would probably be a change to the default in ClippyPlugin

@Daenyth
Copy link
Author

Daenyth commented Dec 20, 2016 via email

@adamw
Copy link
Member

adamw commented Dec 20, 2016

If you would find the time, that would be great :)

Not sure if it's worth moving from the old location, as the gzipped file is now about 2KB

@Daenyth
Copy link
Author

Daenyth commented Dec 21, 2016

I'm not sure how best to handle windows. Right now it's using the user.home java property, but I'd need to switch to checking environment variables. I suppose I could check for the windows one along with the xdg ones, it just seems a little unfortunate that I'll have to effectively add code path branches vs what it's doing now

@adamw
Copy link
Member

adamw commented Dec 21, 2016

Well, if different OSes have different conventions for cache-like local storage, then adding conditional code wouldn't seem wrong in any way to me :) Maybe this could be separate object?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants