Skip to content

Instantly share code, notes, and snippets.

@thingsiplay
Created December 30, 2025 01:42
Show Gist options
  • Select an option

  • Save thingsiplay/5ba043a14ed64d99b351fa07e43ce093 to your computer and use it in GitHub Desktop.

Select an option

Save thingsiplay/5ba043a14ed64d99b351fa07e43ce093 to your computer and use it in GitHub Desktop.
Flatpak list output as JSON format
#!/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