Forum › Forums › General › Software › app-select › Reply To: app-select
My attempt using version on an antiX 26-ish system (app-select-antix: 2.0.12, fluxbox with papirus-antix 48×48 theme).
Your fix assumes that Adwaita theme is installed, which makes it an assumed dependency.
I also get the “Cannot get filename for icon” message but no traceback; did you modify the script?
Anyway, I tried to run pure Python on my antiX install.
from gi.repository import Gtk
x = Gtk.IconTheme.get_default()
y = x.lookup_icon("application-x-executable", 48, 0) # The-hardcoded string should be modified!
y.get_filename()
which produced the following message
<python-input-1>:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version(‘Gtk’, ‘3.0’) before import to ensure that the right version gets loaded.
and the result of get-filename is ‘/usr/share/icons/papirus-antix/48×48/mimetypes/application-x-executable.png’ is selected and this file is present in my system.
@anticapitalX:
What is the output of the following command?
find /usr/share/icons/ -name '*application-x-executable*'
You could switch theme to one that contains it or you could create a “dummy” file of that name in your current theme.
@dave:
A possible fix is to iterate over several options (in order to cover for more themes), icon names and/or sizes, when looking up the icon in the default icon theme.
for an_icon_name in ('application-x-executable', ...): # Other options
if bool(icon_theme.has_icon(an_icon_name)) is True: # The bool(...) is just for sure since e.g. NumPy bool comparison with pure Python's bool fails.
# select and break from the iteration