OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services medium common DISPUTE

Make Flatpak apps show up in the Omarchy launcher

omarchyhyprlandwaylandarchuwsmflatpak
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Symptom and source check out: basecamp/omarchy#8650 exists and describes exactly this (uwsm session XDG_DATA_DIRS=/usr/local/share:/usr/share, Quickshell AppLibrary scanning only that). But the cause is incomplete and one command is wrong. Arch's flatpak package DOES ship /usr/lib/systemd/user-environment-generators/60-flatpak (verified in the package file list), whose whole job is adding the export dirs to the systemd user-manager environment, so 'profile.d is only sourced by login shells' is not the full story. And systemctl --user import-environment XDG_DATA_DIRS copies the value out of the *calling shell*. A terminal opened from the Omarchy session inherits the same broken value, so that step is a no-op at best and re-clobbers the drop-in at worst. The drop-in itself is fine (${HOME} expansion is supported by environment.d) and the danger note about keeping /usr/local/share:/usr/share is correct.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Setting XDG_DATA_DIRS explicitly overrides the default. If you omit /usr/local/share:/usr/share from the value, pacman-installed apps and icon themes will disappear from the launcher instead.

Symptom

I installed an app with flatpak install flathub org.something.App and it runs fine from the terminal with flatpak run, but pressing Super+Space (the Omarchy launcher / app menu) never shows it. Other GUI apps installed with pacman show up fine.

Cause

The graphical session's XDG_DATA_DIRS (as seen by the uwsm-started wayland-wm@hyprland.desktop.service and therefore by the launcher) lacks the Flatpak export dirs. Flatpak ships a systemd user-environment generator (/usr/lib/systemd/user-environment-generators/60-flatpak) that normally adds /var/lib/flatpak/exports/share and $XDG_DATA_HOME/flatpak/exports/share, but generators only run when the systemd user manager starts and cannot override a value the session explicitly sets, so a manager started before Flatpak was installed, or a session that exports its own XDG_DATA_DIRS, keeps the short value. /etc/profile.d/flatpak.sh only fixes login shells, which is why bash -lc 'echo $XDG_DATA_DIRS' looks right while the launcher does not.

Fix

  1. Confirm the entries exist: ls /var/lib/flatpak/exports/share/applications/. 2) Check the session: systemctl --user show-environment | grep XDG_DATA_DIRS. 3) Log out of Hyprland and back in first, because flatpak's 60-flatpak user-environment generator re-runs when the user manager starts, and that alone fixes it on machines where Flatpak was installed after first boot. 4) Only if the variable is still short, add the drop-in:

mkdir -p ~/.config/environment.d
cat > ~/.config/environment.d/flatpak-data-dirs.conf <<'EOF'
XDG_DATA_DIRS=/var/lib/flatpak/exports/share:${HOME}/.local/share/flatpak/exports/share:/usr/local/share:/usr/share
EOF

then log out and back in again. Do NOT run systemctl --user import-environment XDG_DATA_DIRS from a session terminal, because it imports that shell's (broken) value. If you want it applied without a re-login, use a login shell: bash -lc 'systemctl --user import-environment XDG_DATA_DIRS && dbus-update-activation-environment --systemd XDG_DATA_DIRS' and restart the shell/launcher.

Verify

systemctl --user show-environment | grep XDG_DATA_DIRS lists the two flatpak exports/share paths, and the app appears in the launcher after re-login. ls /var/lib/flatpak/exports/share/applications/ shows the .desktop file the launcher should be picking up.

Sources

flatpak-apps-missing-from-omarchy-launcher