Skip to content

Commit 397b455

Browse files
committed
WSLg native-app integration: export XDG_DATA_DIRS to systemd user-bus
Operator 2026-05-10: "flatpak apps no longer showing in windows as native apps". Root cause: WSLg's app-list-monitor service scans XDG_DATA_DIRS for .desktop files and registers them as Windows Start Menu entries via RDP-RAIL. The systemd-user-bus session XDG_DATA_DIRS was EMPTY -- so the monitor only found system /usr/share/applications/*.desktop and missed every flatpak's exports/share/applications/. Result: zero Windows-side Start Menu integration for installed flatpak GUI apps (Epiphany, Nautilus, gnome-software, codium, Flatseal, ExtensionManager). Fix: mios-wsl-env-import.service now sets + propagates XDG_DATA_DIRS=/var/home/mios/.local/share/flatpak/exports/share: /var/lib/flatpak/exports/share:/usr/local/share:/usr/share into the systemd-user-bus + dbus activation environment. Order rationale: ~/.local first -- per-user flatpak installs (operator-added) /var/lib next -- system-wide flatpak installs (mios overlay) /usr/local -- standard XDG fallback /usr -- distro vendor desktop files After the next user-bus startup (or `systemctl --user restart mios-wsl-env-import.service`), WSLg's monitor discovers all six of MiOS's bundled flatpaks and registers them as Windows native apps.
1 parent 8f29504 commit 397b455

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

usr/lib/systemd/user/mios-wsl-env-import.service

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,18 @@ Type=oneshot
3737
# ConditionEnvironment=XDG_SESSION_CLASS=user". Force-setting it
3838
# here unblocks the whole chain.
3939
ExecStart=/usr/bin/systemctl --user set-environment XDG_SESSION_CLASS=user
40-
ExecStart=/usr/bin/systemctl --user import-environment XDG_CURRENT_DESKTOP WAYLAND_DISPLAY DISPLAY XDG_SESSION_TYPE XDG_SESSION_CLASS XDG_RUNTIME_DIR PULSE_SERVER
41-
ExecStart=/usr/bin/dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP WAYLAND_DISPLAY DISPLAY XDG_SESSION_TYPE XDG_SESSION_CLASS XDG_RUNTIME_DIR PULSE_SERVER
40+
# XDG_DATA_DIRS must include flatpak's exports/share dirs so WSLg's
41+
# app-list-monitor sees the flatpak .desktop files and registers them
42+
# as native Windows Start Menu entries via the RDP-RAIL bridge.
43+
# Without this, only system /usr/share/applications/*.desktop are
44+
# discovered -- every installed flatpak (Epiphany, Nautilus, gnome-
45+
# software, etc.) is invisible to Windows. Operator-flagged
46+
# 2026-05-10 "flatpak apps no longer showing in windows as native apps."
47+
# Order: ~/.local first (per-user installs), then /var/lib (system-wide
48+
# installs), then standard /usr/local/share + /usr/share.
49+
ExecStart=/usr/bin/systemctl --user set-environment XDG_DATA_DIRS=/var/home/mios/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
50+
ExecStart=/usr/bin/systemctl --user import-environment XDG_CURRENT_DESKTOP WAYLAND_DISPLAY DISPLAY XDG_SESSION_TYPE XDG_SESSION_CLASS XDG_DATA_DIRS XDG_RUNTIME_DIR PULSE_SERVER
51+
ExecStart=/usr/bin/dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP WAYLAND_DISPLAY DISPLAY XDG_SESSION_TYPE XDG_SESSION_CLASS XDG_DATA_DIRS XDG_RUNTIME_DIR PULSE_SERVER
4252
RemainAfterExit=yes
4353

4454
[Install]

0 commit comments

Comments
 (0)