d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
524 stars 40 forks source link

Default to XDG dir for configuration #211

Closed torrca closed 2 months ago

torrca commented 2 months ago

This patch changes the default configuration directory, internally referred to as ApplicationDir, to comply with XDG's Base Directory Specification.

Most Unix tools already operate on the specification. By adhering it, Nchat becomes more intuitive and integrated with the system.

More information about the spec can be found at: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

The --confdir flag doesn't cover this scenario as it's directed at customization at invokation and not at defaults.

Wasn't sure whether to open an issue as per the contribution guide since this change isn't exactly a bug or feature.

d99kris commented 2 months ago

Hi @torrca - thanks for contributing! 👍

Yes, this request has come up a couple of times before, so this is welcome.

The only issue I can see is handling of "backward compatibility", i.e. allowing existing users to upgrade to latest nchat without needing to take any action. I can probably look into that on my side, as I have an idea how I'd like to handle it. Will try to come back to this PR soonish, this weekend or next.

torrca commented 2 months ago

I can probably look into that on my side, as I have an idea how I'd like to handle it. Will try to come back to this PR soonish, this weekend or next.

Thumbs up.

Lemme know if all goes well.

d99kris commented 2 months ago

Thanks for fixing backward compatibility! The PR generally looks fine. 👍 I'd like some minor refactoring and documentation updates, but I'll merge the PR to a branch first and make the follow-up changes there, before finally merging all to master.

d99kris commented 2 months ago

FYI - the integration branch has been merged to master now as well.

torrca commented 2 months ago

Cheers