Hacker News new | ask | show | jobs
by wpm 57 days ago
XDG stands for X Desktop Group. It absolutely does not stand for Cross Desktop Group and has nothing to do with macOS or Windows, outside of aforementioned X apps on Quartz via XQuartz which as far as I know is completely dead.
2 comments

the successor to xdg, freedesktop.org, however is acknowledging the need for cross platform openness. that's exactly why you indeed can configure where the three main "stores" of compliant applications, their config, their data and their caches.

you can point them to %APPDATA%..., ~/Library or the Linux defaults.

my point in this is: there are free and open conventions and we wouldn't need this "my HOME is cluttered" fuss, if technical teams would embrace them.

so why don't they respect XDG_ env vars for their config and data?

> the need for cross platform openness.

The need for cross platform openness? Did anyone at FDO ask Apple or Microsoft if they wanted to comment or make suggestions on the basedir spec? Did FDO look at either of the platforms' existing specifications and see if there were any ideas they could copy? Or did they just do a Linux-oid thing, disregarding norms and specifications that exist already on the other platforms they didn't invite to the party, and force some weird thing onto those platforms under the assumption that it was good because its open and cross platform.

My complaints come from two things.

1. On my Linux computers, I am inundated by bad applications that do not follow the conventions set out by XDG for basedir. The one good thing basedir lets me do is set my own goddamn directories that aren't dot-file trash, but I still can't depend on it being followed or respected. On this, we seem to agree. But I think the defaults from basedir are terrible and dot-files in general are terrible stupid things, hence the rant.

2. On my Windows and Mac computers, there is no reason for XDG envvars to be set because they do not purport to follow XDG basedir specifications. Thus, even though I could set an envvar for XDG_CONFIG and so on, they are more often ignored by crappy developers. However, I am still highly annoyed by now having at least two places where all of this crap might be, because even if an app developer follows XDG, it is up to me to force them to follow the platforms conventions. All of the basedir directories already have better analogue on macOS, it's ~/Library. Why shouldn't it be on the developer to do a simple `if macOS then put config data in ~/Library/Application Support/APPNAME and caches into ~/Library/Caches/APP_NAME` as is expected and typical on the Mac? Especially since there are no easy ways to set envvars for GUI applications on the Mac, what, am I supposed to make my own shortcuts for everything to set 5 XDG_BLANK envvars to launch an app instead of double-clicking an app bundle?

Err, nope, it is 100% Cross Desktop Group: https://www.freedesktop.org/wiki/

That said, you are correct that it has nothing to do with Windows (and I never said that it did).

That is a backronym[1], it absolutely meant X Desktop Group and likely changed to "Cross Desktop Group" when they switched to Wayland. D-Bus, .desktop files, MPRIS are all listed as FDO specifications alongside the Desktop basedir spec and none of them are appropriate for macOS either.

FDO applies to Linux and "Unix-Like" Operating Systems. macOS is not "UNIX-like", Apple still bothers to get it certified under UNIX 2003 so it is technically not a Unix-like. Again, just because it has a /usr folder and a /var folder and can run a bash shell out of the box doesn't mean all the same mostly just OK standards from Linux should be copy-pasted over.

[1] https://lwn.net/2000/0427/a/freedesktop.html