Created
April 25, 2018 20:46
-
-
Save ali1234/b978cae9a6642b34912ad53f0b210ebc to your computer and use it in GitHub Desktop.
Find the path Gtk loads an icon from.
This file contains 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 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