Re: Is there a way to detect if the System is XDG independently of the environment variables?

Jesús Gómez <[email protected]> Wed, 10 Apr 2024 21:02:13 -0230
Newsgroups gmane.linux.xdg.devel
Message-ID <CAO9z-94WzUiZ9faQzEKaWFWePJ8S+BaBG9XANYZLh6rmC=S=eQ@mail.gmail.com>
--0000000000008bdcb50615c67367
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I'm going to make a claim.

""" Your process runs in a system following XDG if the environment variable
XDG_CONFIG_DIRS is defined OR the folder /etc/xdg exists.  """

Two things are essential to make that claim.  The name of the folder uses
the term `xdg`.  This is different than the rules mentioning `/usr/share`
or the folders at $HOME (e.g. $HOME/.config) in 2 aspects: 1, folders like
`/usr/share` are not unique to systems following the XDG convention; 2, the
folders at $HOME could not exists at first, and still be in a system
following the conventions and so, the process could create those folders in
the first place.

A test like this (if the assumptions I made are valid) could be used by
applications like Clojure (my current interest) to switch between
supporting or not XDG.

But first, I would like to verify that this claim makes sense to you. I
would appreciate any feedback you can give me.


El vie, 29 mar 2024 a la(s) 2:48=E2=80=AFp.m., Jes=C3=BAs G=C3=B3mez (jgomo=
[email protected])
escribi=C3=B3:

> Hi.
>
> I understand that the XDG_* environment variables are options for the
> users to customize their system, but the lack of them doesn't mean that t=
he
> system is not following XDG.
>
> I've been thinking about this, and the more I read the specifications, it
> seems to me that "Systems" don't have that responsibility and it is just =
an
> decision of the applications to follow the specifications or not.
>
> I'm thinking this because of the Clojure CLI tool.  I've been discussing
> about this with the maintainers and there are 2 options:
>
> 1. Or Clojure could detect that the system is following the XDG
> specifications (even when no XDG environment variables are in place).
> 2. Define a flag at any time (installation, execution, packaging, etc., I
> think they will decide that part) for following these specs.
>
> I think the more probable path is the flag, and it corresponds with the
> idea that the System doesn't have a responsibility to express whether it
> follows or not the specifications; but still, given only curiosity, I wou=
ld
> still like to know if the Systems can publish that or if an application c=
an
> detect that.
>
> Thank you!
>

--0000000000008bdcb50615c67367
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I&#39;m going to make a claim.<br><br></div><div>&quo=
t;&quot;&quot; Your process runs in a system following XDG if the environme=
nt variable XDG_CONFIG_DIRS is defined OR the folder /etc/xdg exists.=C2=A0=
 &quot;&quot;&quot;<br></div><div><br></div><div>Two things are essential t=
o make that claim.=C2=A0 The name of the folder uses the term `xdg`.=C2=A0 =
This is different than the rules mentioning `/usr/share` or the folders at =
$HOME (e.g. $HOME/.config) in 2 aspects: 1, folders like `/usr/share` are n=
ot unique to systems following the XDG convention; 2, the folders at $HOME =
could not exists at first, and still be in a system following the conventio=
ns and so, the process could create those folders in the first place.<br><b=
r></div><div>A test like this (if the assumptions I made are valid) could b=
e used by applications like Clojure (my current interest) to switch between=
 supporting or not XDG.<br><br></div><div>But first, I would like to verify=
 that this claim makes sense to you. I would appreciate any feedback you ca=
n give me.<br></div><div><br></div></div><br><div class=3D"gmail_quote"><di=
v dir=3D"ltr" class=3D"gmail_attr">El vie, 29 mar 2024 a la(s) 2:48=E2=80=
=AFp.m., Jes=C3=BAs G=C3=B3mez (<a href=3D"mailto:[email protected]">jgomo3@=
gmail.com</a>) escribi=C3=B3:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><div dir=3D"ltr"><div>Hi.<br><br></div><div>I understand that=
 the XDG_* environment variables are options for the users to customize the=
ir system, but the lack of them doesn&#39;t mean that the system is not fol=
lowing XDG.</div><div><br></div><div>I&#39;ve been thinking about this, and=
 the more I read the specifications, it seems to me that &quot;Systems&quot=
; don&#39;t have that responsibility and it is just an decision of the appl=
ications to follow the specifications or not.</div><div><br></div><div>I&#3=
9;m thinking this because of the Clojure CLI tool.=C2=A0 I&#39;ve been disc=
ussing about this with the maintainers and there are 2 options:<br><br></di=
v><div>1. Or Clojure could detect that the system is following the XDG spec=
ifications (even when no XDG environment variables are in place).<br></div>=
<div>2. Define a flag at any time (installation, execution, packaging, etc.=
, I think they will decide that part) for following these specs.<br><br></d=
iv><div>I think the more probable path is the flag, and it corresponds with=
 the idea that the System doesn&#39;t have a responsibility to express whet=
her it follows or not the specifications; but still, given only curiosity, =
I would still like to know if the Systems can publish that or if an applica=
tion can detect that.<br><br></div><div>Thank you!<br></div></div>
</blockquote></div>

--0000000000008bdcb50615c67367--