scala-clippy icon indicating copy to clipboard operation
scala-clippy copied to clipboard

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

Open Daenyth opened this issue 8 years ago • 5 comments

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/

Daenyth avatar Dec 19 '16 13:12 Daenyth

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

adamw avatar Dec 20 '16 08:12 adamw

Windows would probably be %APPDATA_LOCAL% iirc but I don't use it myself so I'm not sure. If I have time I can pr in. Likely I'll make it check the old location and move the files to avoid extra bandwidth usage if I have time to write it

On Tue, Dec 20, 2016, 3:59 AM Adam Warski [email protected] wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/softwaremill/scala-clippy/issues/29#issuecomment-268190078, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5NLpSMF98BOW-R9MtgWe7dtkQYw14ks5rJ5kFgaJpZM4LQvSw .

Daenyth avatar Dec 20 '16 13:12 Daenyth

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

adamw avatar Dec 20 '16 16:12 adamw

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

Daenyth avatar Dec 21 '16 13:12 Daenyth

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?

adamw avatar Dec 21 '16 14:12 adamw