Skip to content

Instantly share code, notes, and snippets.

@ximion
Created October 6, 2017 16:18
Show Gist options
  • Save ximion/b96c3f9c3d58907be093db4eef7b87aa to your computer and use it in GitHub Desktop.
Save ximion/b96c3f9c3d58907be093db4eef7b87aa to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import gi
gi.require_version('AppStream', '1.0')
from gi.repository import AppStream
from glob import glob
pool = AppStream.Pool.new()
for asdir in glob('/var/lib/flatpak/appstream/*/*/active/'):
pool.add_metadata_location(asdir)
pool.load()
cpts = pool.get_components_by_id('vlc.desktop')
for cpt in cpts:
print('{} - {}'.format(cpt.get_id(), cpt.get_name()))
cpts = pool.get_components_by_id('org.gnome.Glade.desktop')
for cpt in cpts:
print('{} - {}'.format(cpt.get_id(), cpt.get_name()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment