Use $XDG_DATA_HOME instead of hardcoded $HOME/.local/share
I think we cannot retroactively change this without negatively affecting users because existing scripts are already relying on $HOME/.local/share.
https://github.com/search?utf8=%E2%9C%93&q=%22%24HOME%2F.local%2Fshare%2F%24VENDORPREFIX%2Fno_desktopintegration%22&type=Code
At least 56 projects are already relying on the currently specified location. (Gosh, do I love GitHub full text search - how cool is it that you can check if you break something in advance.)
Using $HOME/.local/share also makes the code easier and less error-prone (I have to admit that I dislike configurability because it adds complexity and makes the testing matrices larger).
I understand the little risk this change might bring.
But I would hope that those 56 projects are actively developed and might release new versions which have adapted that check. I have not seen XDG_DATA_HOME set that often, so chance that users will be affected might be low (they might have complained already otherwise, given that "broken software looks in the wrong place and ignores XDG_DATA_HOME").
Using the hard-coded $HOME/.local/share instead of the specified variable, which is otherwise well respected in lots of code, sends a bad signal IMHO to everyone one wants to work together on new specifications in the future :(
So I would rather go and fix the AppImage spec to comply with the XDG spec in this early phase, before a first released version of the spec has been released. After all, right now the spec is a draft, or?
After all, right now the spec is a draft, or?
There you have a point. For reasons exactly like this.
Can we have it check both places?
+1 for following the XDG Base Directory Specification. By the way, the spec says:
If
$XDG_DATA_HOMEis either not set or empty, a default equal to$HOME/.local/shareshould be used.
So switching to $XDG_DATA_HOME and specifying $HOME/.local/share as a fallback should do the trick.
I am with @kossebau here, the change shouldn't significantly break stuff. Many tools using AppImages use XDG_DATA_HOME already.
Can we explicitly add a pointer to
If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used
@kossebau? Just to ensure that implementers don't forget this important detail. Thanks!
@probonopd just add a link to the XDG spec, as that's defined by them, and that way the information doesn't look like an invention of us.
Yes, something like "Please especially note that as per the XDG spec, If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used".
I voice my support for this, many appimage related applications already support the XDG spec, and at AM we even went beyond and started supporting $XDG_BIN_HOME even though it is not in the spec.
It should be as simple as changing this, for example changing:
$HOME/.local/share/appimagekit/no_desktopintegration
for
${XDG_DATA_HOME:-$HOME/.local/share}/appimagekit/no_desktopintegration
No need to make a separate line for each instance where a XDG variable is applicable.