omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Flatpak apps don't appear in the launcher: session XDG_DATA_DIRS misses Flatpak export dirs

Open lde-alen opened this issue 3 months ago • 3 comments

Summary

Flatpak-installed applications are invisible in the Omarchy app menu/launcher (Apps menu / omarchy-menu toggle apps). Newly installed Flatpaks are never added automatically.

What I expected

After flatpak install <app>, the app's .desktop entry should be listed in the launcher, ideally live as soon as the install finishes.

What happens instead

The app never shows up. The launcher's app list (Quickshell DesktopEntries, wired up in /usr/share/omarchy/shell/services/AppLibrary.qml) only scans the directories in XDG_DATA_DIRS as seen by the running shell process, and that variable is missing the Flatpak export dirs.

The Hyprland/omarchy session is spawned by uwsm/systemd ([email protected]) with:

$ systemctl --user show-environment | grep XDG_DATA_DIRS
XDG_DATA_DIRS=/usr/local/share:/usr/share

$ tr '\0' '\n' </proc/$(pgrep -o quickshell)/environ | grep XDG_DATA_DIRS
XDG_DATA_DIRS=/usr/local/share:/usr/share

A normal login shell gets the Flatpak dirs from /etc/profile.d/flatpak.sh:

$ bash -lc 'echo $XDG_DATA_DIRS'
/home/myvh/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

But profile.d never runs in the graphical session, so /var/lib/flatpak/exports/share/applications/*.desktop (and the user-level equivalent) is never scanned. The .desktop files are present and valid (verified: com.pokemmo.PokeMMO.desktop exists in /var/lib/flatpak/exports/share/applications/ and is not in launcher.hides).

Steps to reproduce

  1. Fresh Omarchy install.
  2. flatpak install flathub com.pokemmo.PokeMMO (any Flatpak app).
  3. Open the Apps menu (default SUPER + ALT + SPACE) and search for the app.
  4. It is missing.

Suggested fix

Ensure the systemd/user session environment includes the Flatpak export dirs. Options:

  • Ship an environment.d//etc/environment.d drop-in (or equivalent) that prepends $XDG_DATA_HOME/flatpak/exports/share and /var/lib/flatpak/exports/share to XDG_DATA_DIRS for the user session; or
  • Add the Flatpak dirs explicitly to the launcher's DesktopEntries/AppLibrary scan.

Ideally the launcher should then pick new Flatpak installs up live (Quickshell already watches the scanned applications dirs and refreshes on DesktopEntries.applications.valuesChanged).

Environment

  • Omarchy 4.0.1-1
  • quickshell 0.3.1-1
  • XDG_CURRENT_DESKTOP=Hyprland
  • Session managed by uwsm ([email protected])

Workaround

# ~/.config/environment.d/flatpak-data-dirs.conf
XDG_DATA_DIRS=/home/<user>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

plus systemctl --user import-environment XDG_DATA_DIRS and a shell/session restart.

lde-alen avatar Aug 27 '26 18:08 lde-alen

Independent confirmation of a second failure mode on Omarchy 4.0.1-1 with Quickshell 0.3.1-1.

After installing a system-scoped Flatpak, its launcher was absent from Apps search until Omarchy Shell restarted. Before the restart I verified all of the following:

  • The exported .desktop file existed under /var/lib/flatpak/exports/share/applications/ and was not hidden.
  • XDG_DATA_DIRS in both the running Quickshell process and the systemd user-manager environment already included the user and system Flatpak export directories.
  • gtk-launch <desktop-id>.desktop launched the application successfully.
  • Apps search still did not return it.

omarchy restart shell made the launcher appear immediately.

This means the missing session environment described in the original report is one valid cause, but not the only cause. With the search paths already correct, the live DesktopEntries/AppLibrary refresh path can still miss the newly exported entry. I have not yet isolated whether this is an Omarchy AppLibrary.qml issue, a Quickshell watcher issue, or a one-time event race during installation.

I generated omarchy-debug --no-sudo --print locally, but the full output contains unrelated host and network identifiers, so I am not attaching it. Relevant versions are included above.

SmithLabsLLC avatar Aug 31 '26 04:08 SmithLabsLLC

Still biting on quattro here. I shipped a launcher menu clone that scans the flatpak export dirs itself (icons too) and launches with flatpak run, since the session XDG_DATA_DIRS path wasn't getting fixed for my machine any time soon: https://github.com/outcrop-labs/skal-menu. Marketplace submission pending at omacom/omarchy-plugin-marketplace#8193.

joniler avatar Sep 22 '26 20:09 joniler

I reproduced this on a clean Omarchy 4.0.4 worker (quickshell 0.3.1, uwsm 0.26.7, SDDM autologin) and found two separate things.

The session environment is fine after a fresh login. With flatpak installed and the machine rebooted, both systemctl --user show-environment and the running quickshell process had XDG_DATA_DIRS=/home/omarchy/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share. SDDM's wayland-session runs a login shell, and uwsm start sources /etc/profile again in prepare-env.sh, so /etc/profile.d/flatpak.sh does run. The value in the report, /usr/local/share:/usr/share, is what a session has when the flatpak package itself was installed after that session started: a running session keeps the environment it logged in with. Logging out and back in once after installing flatpak fixes that part, so an environment.d drop-in would not change anything on a stock install.

What is still broken is live pickup of a new export directory, which is the failure @SmithLabsLLC describes. On the worker, with the Flatpak dirs already in XDG_DATA_DIRS but ~/.local/share/flatpak/exports/share/applications not yet existing when the shell started, I created that directory with one .desktop file in it. Apps search did not list it. When a different .desktop file was then added to ~/.local/share/applications, which the shell already watches, the missing entry appeared along with it. The launcher reads Quickshell's DesktopEntries (shell/services/AppLibrary.qml), which rescans every data dir but only sets up watches on applications directories that exist at startup. A first flatpak install creates the export directory, so that install is not seen until something else triggers a rescan or the shell restarts (omarchy restart shell).

The second opinion, Codex at medium effort, agreed on both points independently of the worker run. It also traced the watch gap to Quickshell 0.3.1's desktopentrymonitor.cpp, which skips applications dirs that do not exist yet before it registers their watches. I did not check that file myself, since the source is not on this machine. It also pointed out that the comment in default/uwsm/env.d/10-omarchy saying uwsm does not source /etc/profile.d does not match this login path.

I have not opened a fix. The real defect is in how Quickshell watches directories, so the fix is a choice between patching Quickshell (upstream, or in the package Omarchy ships) and adding a watcher in Omarchy's shell. That choice is the maintainer's, so this issue is waiting on them. Until then, after installing a Flatpak app for the first time, run omarchy restart shell. If flatpak itself was installed in the current session, log out and back in.

omarchybot avatar Oct 09 '26 05:10 omarchybot