Improve and simplify profile snippet
Improve and simplify profile snippet

Avoid setting a temporary variable flatpak_dirs which, while not
exported to the environment, would still be defined as a
shell "parameter" (variable) in the login shell itself.

Consistently put the Flatpak directories before other XDG_DATA_DIRS,
rather than putting them last if XDG_DATA_DIRS happens to be already
set.

Expand XDG_DATA_HOME if necessary, rather than assuming it will
always be ~/.local/share.

I don't know exactly which shells source profile.d, but it's possible
that one of them might only implement POSIX test syntax, so prefer
[ x = y ] over [ x == y ].

Fix some insufficient quoting that could have gone wrong if
XDG_DATA_DIRS somehow contained spaces.

Signed-off-by: Simon McVittie <0e1aea601907c1a85c2dc96e5ea37e23c58d2e9b@debian.org>

matthiasclasen/flatpak,flatpak/flatpak,GeorgesStavracas/flatpak,matthiasclasen/flatpak,GeorgesStavracas/flatpak,handsome-feng/flatpak,flatpak/flatpak,flatpak/flatpak,GeorgesStavracas/flatpak,flatpak/flatpak,handsome-feng/flatpak,handsome-feng/flatpak,matthiasclasen/flatpak,flatpak/flatpak,GeorgesStavracas/flatpak,matthiasclasen/flatpak,GeorgesStavracas/flatpak,handsome-feng/flatpak,matthiasclasen/flatpak,handsome-feng/flatpak