Discussion on which XDG folder to put ZSH files in


Since there are a bunch of plugins in the ZDOTDIR folder besides the .zshrc file, it seems a bit inappropriate to set the ZDOTDIR folder to the XDG_CONFIG_HOME folder.
And history is not a session file, I think it is not appropriate to place it in the XDG_STATE_HOME folder, is this setting reasonable?

In fact, the fcitx5 input method puts more lexicon files and a configuration file under the XDG_DATA_HOME folder, which seems to be similar to the ZSH scene. XDG_DATA_HOME should be used to store files similar to history or useful data, from the convenience From the point of view, it can also be used for mixed storage of a small amount of configuration files and data files.

XDG_CONFIG_HOME should be used to store configuration files from the name, XDG_DATA_HOME should store useful data, XDG_STATE_HOME should be used to store session files that are not particularly useful, and XDG_CACHE_HOME is used to store cache files that are completely unnecessary to delete.

This is how I understand it, what do you think?

May i ask in which files you got those lines from?

As a general idea, i think the “Mailing-lists” or “IRC” channels mentioned at https://zsh.sourceforge.io/ would be a better place to ask about these kind of stuff from the ZSH maintainers right?
Because i think all distros use their sources with these kind of configs.

Again i’m not sure where you got those lines, so i can’t really comment on your ideas at moment…

1 Like

The code was obtained a year ago from a gist page, and I also got some plugins, of course, the use of the XDG directory is only my personal opinion, I have no idea if it is correct.:kissing:

Then I’m using zi plugin manager.

:rofl: Didn’t it occur to you then that asking that to the maker of that gist instead?
Because it is obviously something that code uses in it’s logic then :woman_shrugging:

Because the default install on Manjaro doesn’t use those, it uses the defaults from the zsh package itself…
See man zshall

When it comes to the usage of those XDG_xxxx variables you should consult the specs for how they are meant to be used:

I was actually tweaking the mess of hidden files and folders in my home directory following archwiki’s XDG page, and I looked at the XDG specification, but the actual software developers’ practices were a bit confusing.:sweat: