core-agent-linux/qubes-rpc/xdg-icon
Marek Marczykowski-Górecki 3b0f80e19f
Make shebang explicit /usr/bin/python2 where it's still there
Both Archlinux and Fedora 29 have guidelines to point explicitly at
/usr/bin/python2 where it expect python2.

Also, do not use env.

Fixes QubesOS/qubes-issues#4027
2018-10-24 00:24:50 +02:00

22 lines
506 B
Python
Executable File

#!/usr/bin/python2
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:
print "Usage:", sys.argv[0], "ICON SIZE"
sys.exit(1)
for theme in themes:
icon = xdg.IconTheme.getIconPath(sys.argv[1], theme = theme, size = int(sys.argv[2]))
if icon is not None:
break
if icon is None:
sys.exit(1)
print icon