21 lines
374 B
Python
21 lines
374 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
|
||
|
if len(sys.argv) < 2:
|
||
|
sys.stderr.write("usage: check-icon.py <icon name>\n")
|
||
|
sys.exit(-1)
|
||
|
|
||
|
import gi
|
||
|
gi.require_version("Gtk", "3.0")
|
||
|
from gi.repository import Gtk
|
||
|
|
||
|
theme = Gtk.IconTheme.get_default()
|
||
|
icon = theme.lookup_icon(sys.argv[1], 48, 0)
|
||
|
if icon:
|
||
|
print("true")
|
||
|
sys.exit(0)
|
||
|
else:
|
||
|
print("false")
|
||
|
sys.exit(1)
|