Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default khal.db location #1296

Open
balejk opened this issue Sep 17, 2023 · 3 comments
Open

default khal.db location #1296

balejk opened this issue Sep 17, 2023 · 3 comments

Comments

@balejk
Copy link

balejk commented Sep 17, 2023

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 :-)

@balejk
Copy link
Author

balejk commented Sep 17, 2023

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).

@WhyNotHugo
Copy link
Member

I agree that cache data should be stored in $XDG_CACHE_HOME.

@IOZZYS
Copy link

IOZZYS commented Apr 8, 2024

Wow, I just came here to say thank you to everyone maintaining this piece of software, this is amazing.

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

No branches or pull requests

3 participants