default khal.db location
balejk opened this issue · comments
If I'm not mistaken, khal.db is just a cache file and as such it would make more sense to me to store it under XDG_CACHE_HOME by default instead of XDG_DATA_HOME. This is of course a minor thing and perhaps slighly subjective, on the other hand for example todoman follows this scheme. It can also be useful for instance when creating backups where the entire ~/.cache directory might be skipped as non-essential, but not so ~/.local (not that the usual size of the database would make that much of a difference, but I imagine the binary format could make it harder for deduplication algorithms to be efficient and small changes in the database could cause unnecessary amount of data to get backed up on incremental backups).
Please note that I'm aware that the path can be configured (which makes this even a more minor thing) - I'm talking about the default location.
The change required to make this switch should be simple, however I cannot think of a good simple way of moving the existing file to the new location, so the least evil would probably be just leaving it there for the user to delete it manually (a notice could be put in the changelog) and generating a new one. No changes would occur if the user has specified a custom path for the file in his configuration file.
Of course, if you disagree with this or don't think it's worth changing it anymore, feel free to close this :-)
Another possible solution (in particular for use with some backup software) could be the CACHEDIR.TAG mechanism, but this doesn't seem suitable when there is just one cache file and could even lead to unintended consequences if the user decided to store some other data under the same directory - which a) would make sense as application related data is what XDG_DATA_HOME is actually intended for and b) could cause some more serious things if the user specified a custom path (unless the tag would not get generated by khal in such case; such as placing it at some non-khal specific place with a lot of unrelated data files which then might not get backed up or even worse, get pruned as cache).
I agree that cache data should be stored in $XDG_CACHE_HOME
.
Wow, I just came here to say thank you to everyone maintaining this piece of software, this is amazing.