Hacker News new | ask | show | jobs
by 2mlWQbCK 473 days ago
Clean hierarchy? How do I even guess if some config-file is hidden in ~/.config/ or ~/.local/share? I never figured that out. Looking at the contents of those directories here I can't guess better than a coin-toss. Why not just have a single ~/.dotfiles or something (if hidden files in ~/ is somehow a problem that needs to be solved)?
1 comments

> How do I even guess if some config-file is hidden in ~/.config/ or ~/.local/share

A config file always belongs in ~/.config/PROGRAM. It never belongs in ~/.local/share/PROGRAM.

Data files (e.g. icons) belong in ~/.local/share/PROGRAM.

User-specific state (e.g. window positions) belongs in ~/.local/state/PROGRAM.

Executables belong in ~/.local/bin/.

Cached files (which may be deleted any time for space) belong in ~/.cache.

Source: https://specifications.freedesktop.org/basedir-spec/latest/

> Why not just have a single ~/.dotfiles or something (if hidden files in ~/ is somehow a problem that needs to be solved)?

I believe that the answer is that certain of those directories make sense to share across different hosts (e.g. your laptop and desktop) and others don’t.

> I believe that the answer is that certain of those directories make sense to share across different hosts (e.g. your laptop and desktop) and others don’t.

Also; Some of those directories make sense to flag for backup in your favorite backup software (personal settings, data files, etc), where others (cache) make sense to not waste drive space on backing up.