core-agent-linux/qubes-rpc/xdg-icon

22 lines
529 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/python3
import xdg.IconTheme
import sys
import os
themes = ['Humanity', 'Adwaita', 'gnome', 'oxygen']
themes = themes + sorted([d for d in os.listdir("/usr/share/icons") if d not in themes and os.path.isdir("/usr/share/icons/" + d)])
if len(sys.argv) < 3:
2019-09-18 01:47:46 +02:00
print("Usage:", sys.argv[0], "ICON SIZE")
sys.exit(1)
for theme in themes:
2019-09-18 01:47:46 +02:00
icon = xdg.IconTheme.getIconPath(sys.argv[1], theme = theme, size = int(sys.argv[2]))
if icon is not None:
break
if icon is None:
2019-09-18 01:47:46 +02:00
sys.exit(1)
print(icon)