Skip to content

Instantly share code, notes, and snippets.

@ali1234
Created April 25, 2018 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ali1234/b978cae9a6642b34912ad53f0b210ebc to your computer and use it in GitHub Desktop.
Save ali1234/b978cae9a6642b34912ad53f0b210ebc to your computer and use it in GitHub Desktop.
Find the path Gtk loads an icon from.
#!/usr/bin/env python3
import sys
import pathlib
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
if __name__ == '__main__':
theme = Gtk.IconTheme.get_default()
icon = theme.lookup_icon(sys.argv[1], 16, 0)
pixbuf = theme.load_icon(sys.argv[1], 16, 0)
print(pixbuf)
print(icon.get_filename())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment