Code: Select all
Note that the directories
'/var/lib/flatpak/exports/share'
'/home/chris/.local/share/flatpak/exports/share'
are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.
With reference to this StackExchange post, I've tried ~/.profile, ~/.xsessionrc. I've also tried .bash_profile, which gets rid of the warning in the shell, even though the link from the main answer in that post says not to create this file because it stops .profile being read (.bash_profile removed the warnings whereas .profile didn't so hmm) - this doesn't help with the menu situation however, so I think that's only worked for the interactive shell not my entire user environment.
I even added it to /usr/bin/startlxde-pi, which I really didn't want to do, and even that doesn't work!
flatpak itself adds the entries to run by systemd (systemctl --user show-environment does actually show the correct XDG_DATA_DIRS) and other places.
My XDG_DATA_DIRS is set to:
/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:/usr/local/share/:/usr/share/:/usr/share/gdm/:/var/lib/menu-xdg/
There are duplicates in there and it's clearly being overridden by something but I can't figure out what.
I found a blog post from last year with perhaps the same issue, which advises to add the entries manually. There must be a better way!
Any ideas what might be setting XDG_DATA_DIRS very late on login to the desktop?
edit I had a look at the log file in ~/.cache/lxsession/LXDE/run.log, it contains these lines:
Code: Select all
** Message: 12:38:23.003: environement.vala:58: Exporting primary_variable
** Message: 12:38:23.003: environement.vala:59: desktop_environnement XDG_CURRENT_DESKTOP
** Message: 12:38:23.003: environement.vala:150: confir_dirs is null, export : /etc/xdg
** Message: 12:38:23.003: environement.vala:184: Exporting XDG_CONFIG_DIRS
** Message: 12:38:23.003: environement.vala:218: custom_data :/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:
** Message: 12:38:23.003: environement.vala:219: data_dirs :/usr/local/share/:/usr/share/:/usr/share/gdm/:/var/lib/menu-xdg/
** Message: 12:38:23.003: environement.vala:220: data_dirs not null, export : /usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg:/usr/local/share/:/usr/share/:/usr/share/gdm/:/var/lib/menu-xdg/
** Message: 12:38:23.003: environement.vala:225: Exporting XDG_DATA_DIRS

Hmm, https://valadoc.org/glib-2.0/GLib.Envir ... iable.html states that "The returned string may be overwritten by the next call to get_variable, set_variable or unset_variable.", which may be what is happening here as the strings aren't copied? This could be a bug in lxsession but I can't see how to report it!