News for hackers. Stuff that matters.
Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by bheadmaster on Thursday March 06, 2025 @03:27AM (#43277816)
> This is the crap responsible for poluting $HOME.

I think people who wrote software used $HOME for dotfiles way before XDG even existed.

> If the user does not configure anything, just use global defaults.

And if he does, where do you put the dotfiles? $HOME? XDG defines an cleaner hierarchy.

Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by 2mlWQbCK on Thursday March 06, 2025 @10:16AM (#43281191)
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)?
Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by eadmund on Thursday March 06, 2025 @11:29AM (#43282023)
> 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.

Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by blooalien on Thursday March 06, 2025 @05:29PM (#43285680)
> 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.

Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by wang_li on Thursday March 06, 2025 @11:14AM (#43281840)
I believe the point they are making is that for plenty of tools people don't change any configuration settings. If I haven't changed from the application default setting, why is the application creating a configuration file in my home directory hierarchy?
Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by hulitu on Thursday March 06, 2025 @06:19PM (#43286023)
Yes. That's the point. If i didn't ask for (a config) file, don't create one.
Re:Xdg-ninja: checking your $HOME for unwanted files and dir... by johnisgood on Friday March 07, 2025 @01:19PM (#43292625)
As a developer, I would rather have a default configuration file than hardcode the defaults into my own code, but that is just my opinion.