cups icon indicating copy to clipboard operation
cups copied to clipboard

XDG Base Dir Compliance

Open maddovr opened this issue 5 years ago • 4 comments

Would it be possible to move the configuration inside .cups into ~/.config/cups? This would help keep our home directory clean and it should be the way to go in the future.

maddovr avatar Oct 16 '20 12:10 maddovr

~/.config is specific to Linux. And CUPS has used ~/.cups since v1.2 (where it moved from ~/.lpoptions).

michaelrsweet avatar Oct 16 '20 12:10 michaelrsweet

~/.config is specific to Linux. And CUPS has used ~/.cups since v1.2 (where it moved from ~/.lpoptions).

It is actually not. While the initiative did indeed start from freedesktop.org (the spec here), it is respected by most unix operating system like the BSDs due to the fact that many such OS run linux-compatible programs.

maddovr avatar Oct 16 '20 12:10 maddovr

~/.config is specific to Linux. And CUPS has used ~/.cups since v1.2 (where it moved from ~/.lpoptions).

It is actually not. While the initiative did indeed start from freedesktop.org (the spec here), it is respected by most unix operating system like the BSDs due to the fact that many such OS run linux-compatible programs.

Apologies for chiming in, but is there any actual benefit in doing this? Are we simply arguing the semantics of configuration being stored in ~/.cups vs ~/.config/cups? If so, by virtue of using ~ to resolve the user's home is that not already XDG base path compliant?

Furthermore, I don't think relying on a spec which is only officially implemented in Linux distributions is safe for ensuring compatibility on non-Linux distributions despite most implementing this specification.

Matthew-Beckett avatar Oct 16 '20 13:10 Matthew-Beckett

https://ploum.net/207-modify-your-application-to-use-xdg-folders/

Every OS has its platform-specific preferred location for:

  • configuration (which might be checked into git as dotfiles)
  • cache (which might be on a tmpfs or deleted whenever you need space, since it can be perfectly recreated at any time but only serves to speed up the program if it exists)
  • user data associated with the program (which might be regularly backed up to off-site storage, or exist on dedicated data drive mounts)

It's actually a very valued end user feature to be able to treat application data differently depending on what it's used for. You don't want to check caches into git, or waste time syncing them to daily backups. You don't want anything else to get accidentally deleted as useless. You don't want to check data into git, but you do want to be able to diff and follow the evolution of config settings in git.

XDG defines these for linux. Windows uses %APPDATA% and similar. MacOS puts this into locations within ~/Library

I don't know what the *BSDs do, I don't think they get quite as much attention and as far as I can tell they don't officially bless anything... So since the macOS and Windows standards are not applicable to BSD I suspect most programs that implement this for the other OSes just lump BSD in with linux on this. It's certainly not harmful as long as it's consistent.

eli-schwartz avatar Oct 16 '20 16:10 eli-schwartz