Skip to content

Instantly share code, notes, and snippets.

@ximion
Created October 6, 2017 16:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#!/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