Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the full file path of an icon name?

How can I get the full file path from an icon name in GNOME?

like image 293
david4dev Avatar asked May 22 '11 19:05

david4dev


2 Answers

import gtk
icon_theme = gtk.icon_theme_get_default()
icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0)
print icon_info.get_filename()
like image 122
Flimm Avatar answered Nov 15 '22 08:11

Flimm


Translation for Python 3:

from gi.repository import Gtk
icon_theme = Gtk.IconTheme.get_default()
icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0)
print(icon_info.get_filename())
like image 9
zbyszek Avatar answered Nov 15 '22 08:11

zbyszek