util: add flatpak introspection utilities #1234
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
👋
I'm using DMS on zirconium which is a universal blue/bootc project, so many pieces of software are installed via flatpak rather than via package manager.
I noticed that matugen tries to determine whether or not to generate theme files for supported applications based on some shell execs in the utils dir. I'm hoping to contribute some work in a follow-on PR that allows the configuration in
core/internal/matugen/matugen.goto take flatpak package IDs, for example something like:The semantics of how to implement that can be hashed out later, but this PR contributes some simple utils that would be needed to have matugen interact with flatpaks more broadly. The utils aren't rigged up or called from any other part of the codebase currently, but it provides the following util funcs for getting flatpak info:
FlatpakInPath- determines if the user even has flatpak installed, that way we can fail fast if notFlatpakExists- for a given fully-qualified flatpak id (foo.bar.myapp) returns whether or not the package is installed on host systemFlatpakSearchBySubstring- for a conventional app name ("calculator") returns whether or not a package with a matching name exists on host system (org.calc.calculator)FlatpakInstallationDir- gets the home sandbox dir for a sandbox. Probably helpful if future matugen work wants/needs to stuff configs directly into the sandbox dir of the flatpakI have also added some steps to the go-ci.yml file for installing flatpak onto the runner so that my tests can run in the CI environment. Long term it would probably be best to just pick a runner that has flatpak pre-installed, or bake an image that adds flatpak onto ubuntu-latest to prevent needing to do all that network shit on every PR commit 🙃
I wanted to just propose this smaller PR initially that stubs out the core set of interactions with flatpak, but I'm happy to also chat here more about ideas or concerns about integrating flatpak support into matugen.
Let me know what you folks think - I'm happy to adapt or adjust this if needed. Thanks for all the amazing work on DMS!