mlj / castget

A simple, command-line based RSS enclosure downloader, primarily intended for automatic, unattended downloading of podcasts.
http://castget.johndal.com
GNU General Public License v2.0
103 stars 23 forks source link

Implement XDG Base directory specification #58

Open laalsaas opened 2 years ago

laalsaas commented 2 years ago

I think castget should implement the XDG Base directory specification1. This would mean moving the default location of the castgetrc to $XDG_CONFIG_HOME, if that's not set $HOME/.config. ~/.castgetrc could still be used as fallback location for backwards compatibility.

The directory ~/.castget would be moved to $XDG_DATA_HOME or if this is not set, $HOME/.local/share. For backwards compatibility, I'd suggest a mechanism which checks these directories exist in this order: $XDG_DATA_HOME/castget -> $HOME/.local/share/castget -> ~/.castget. The first directory found is used. If there is no directory found, create $XDG_DATA_HOME/castget, or (if not variable not set) $HOME/.local/share/castget.

I would really like this feature, since it would stop castget from clogging up my home directory.

laalsaas commented 2 years ago

I'd be willing to work on this if you are willing to incorparete the features described above. Please let me know what you think.

laalsaas commented 2 years ago

I just realized, there already is #42 which implements it for the config file part, though it uses the reverse priorities. But since it's open for more than two years: Do you even consider merging it? If not, why aren't you closing this PR? Are you still actively maintaining this project?

I could implement the second part with the data home, if you just told me: "let's do this".

mlj commented 2 years ago

Hi,

Let's do this :) Castget is maintained but it's not a project that I follow up on on a daily basis any longer, so please expect less than instant turn-around time, but if you're willing to do the work, I'm of course happy to merge it.

As you say there's an incomplete implementation in #42. Feel free to build on that or start over with the directory priority you outline in your first comment, which I agree would be preferrable. Your proposal re. backwards compatibility also makes sense.

Please also make sure to update the man pages. It's probably not realistic to add any testing given the ad hoc unit testing that castget has, but if you spot an opportunity for adding some testing, that would be ideal.