mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-10 23:57:44 -04:00
3891a228c61196516d1f44faa2249ae705218cf2
flatpak --installations for fish if already in XDG_DATA_DIRS
Sourcing profile/flatpak.fish spawns `flatpak --installations` on every fish shell startup, which costs ~15 ms on a typical desktop and dominates fish's non-interactive init time when flatpak is installed. On any system where the login stack (pam_env, systemd user session, distro-specific init) has already populated XDG_DATA_DIRS with the canonical user flatpak export path, this spawn is redundant: the subsequent `contains` loop would be a no-op because the canonical entry is already there. Add a fast-path guard that checks for `$XDG_DATA_HOME/flatpak/exports/share` (falling back to `$HOME/.local/share/flatpak/exports/share` when XDG_DATA_HOME is unset) at the top of the script. When present, skip the slow path entirely. The slow path is preserved verbatim for sessions where the canonical entry is missing — e.g. a freshly-created user, or environments where session init hasn't populated XDG_DATA_DIRS yet — so custom installations configured via /etc/flatpak/installations.d/*.conf are still discovered in that case. Measured on Linux with `hyperfine --warmup 5 'fish -c exit'`: before: ~23 ms of startup spent in `flatpak --installations` after: ~10 us (a single `contains` check) on the common path.
…
…
…
…
…
…
…
…
…
…
…
…
Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux.
See https://flatpak.org/ for more information.
Flatpak is available in the package repositories of most Linux distributions and can be installed from there. See https://flatpak.org/setup/ for quick setup instructions for many distributions.
Community discussion happens in #flatpak:matrix.org, on the mailing list, and on the Flathub Discourse.
Read documentation for Flatpak here.
Contributing
Flatpak welcomes contributions from anyone! Here are some ways you can help:
- Fix one of the issues and submit a PR
- Update flatpak's translations and submit a PR
- Improve flatpak's documentation, hosted at http://docs.flatpak.org and developed over in flatpak-docs
- Find a bug and submit a detailed report including your OS, flatpak version, and the steps to reproduce
- Add your favorite application to Flathub by writing a flatpak-builder manifest and submitting it
- Improve the Flatpak support in your favorite Linux distribution
Hacking
See CONTRIBUTING.md
Related Projects
Here are some notable projects in the Flatpak ecosystem:
- Flatseal: An app for managing permissions of Flatpak apps without using the CLI
- Flat-manager: A tool for managing Flatpak repositories
Languages
C
91.2%
Shell
6%
Meson
1.1%
Python
0.9%
Yacc
0.8%
