Created
December 30, 2025 01:42
-
-
Save thingsiplay/5ba043a14ed64d99b351fa07e43ce093 to your computer and use it in GitHub Desktop.
Flatpak list output as JSON format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Flatpak list output as JSON format | |
| # Examples with jq: | |
| # flatpak-list-json | jq -r '.[].name' | |
| # flatpak-list-json | jq -r '.[0:2].[].application' | |
| # flatpak-list-json | jq '.[0:2]' | |
| # flatpak-list-json | jq '.[] | select(.description | contains("video"))' | |
| columns='name,description,application,version,branch,branch,arch,runtime,origin,installation,ref,active,latest,size,options' | |
| # Default show all flatpaks, use flatpak --app or --runtime option to limit type of package. | |
| flatpak list --app --columns "${columns}" | | |
| column \ | |
| --json \ | |
| --table-name 'flatpak' \ | |
| --table-columns "${columns}" \ | |
| --separator $'\t' \ | |
| --keep-empty-lines | | |
| jq '.flatpak[0:]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment