Note that $XDG_DATA_DIRS
, like $PATH
, is set in /etc/profile.d/apps-bin-path.sh
but also /usr/lib/environment.d/990-snapd.conf
. I think setting XDG_DATA_DIRS
is required for the snaps to appear in the menu.
Now the question remains why $XDG_DATA_DIRS
and $PATH
are not set in graphical sessions - perhaps the difference you see between root and users is actually a difference between graphical sessions and login sessions? The cause might be the windows manager for example.
See for example: