sonnyp / Junction

Application/browser chooser
https://flathub.org/apps/re.sonny.Junction
GNU General Public License v3.0
457 stars 28 forks source link

Clean up `$XDG_DATA_DIRS` and adhere to the XDG Base Directory Specification #150

Open antecrescent opened 2 months ago

antecrescent commented 2 months ago

The first commit fixes a startup error (#115), when $XDG_DATA_DIRS is not defined and thus gets incorrectly set to :/run/host/usr/share:/var/lib/snapd/desktop:/var/lib/flatpak/exports/share:${HOME}/.local/share/flatpak/exports/share while the XDG Base Directory Specification states:

If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used.

The second commit removes entries from $XDG_DATA_DIRS that Snapd and Flatpak set themselves already.

I found a downstream incident report, where Junction "doesn't work with programs that do their own weird stuff and end up clearing the env". I didn't investigate this further, since I believe that this was either a user error or the programs in question need to properly handle $XDG* variables. I mentioned it in case it's relevant to this PR.