feat(flatpak): link installed apps into the desktop launcher

When a flatpak app is installed through the app, its .desktop entries and
icons are now symlinked into the user's standard XDG dirs
(~/.local/share/{applications,icons}), which every desktop scans by default.
This makes flatpak apps appear in any launcher (wofi, GNOME, KDE...) the same
way a pacman install would, without relying on XDG_DATA_DIRS or any
desktop-specific configuration. The links are removed on uninstall, and a
refresh re-links every installed app so ones installed before this feature
(or outside the app) self-heal.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-08-29 16:54:39 +02:00
1 parent 6224a94df6
commit a1d8c96e4e
2 files changed
+123 -1

No files matched your search

+12
View File
@@ -49,6 +49,18 @@ public:
std::vector<PackageInfo> listUpdates() override;
bool refresh(std::function<void(const std::string&)> progressCallback = nullptr) override;
// Make an app appear in the desktop's application launcher (wofi, GNOME,
// KDE, ...) regardless of XDG_DATA_DIRS, like a pacman install would: link
// its .desktop entries and icons from flatpak's exports into the user's
// standard XDG directories (~/.local/share/{applications,icons}). Exposed
// as static so the linking can be unit/integration tested without flatpak.
static void integrateDesktopEntries(const std::string& appId);
static void uninstallDesktopEntries(const std::string& appId);
// Re-link every installed app so launchers pick up apps whose integration
// is missing (e.g. installed before this feature existed).
void integrateAllInstalled();
private:
bool isInstalled(const std::string& appId);