diff options
Diffstat (limited to 'logout-manager.py')
-rwxr-xr-x | logout-manager.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/logout-manager.py b/logout-manager.py index d1583e6..33795fd 100755 --- a/logout-manager.py +++ b/logout-manager.py @@ -54,8 +54,21 @@ def get_scaled_icon(icon_name, size=24, fallback_icon_name = "", icon_theme = "d icon_info = this_theme.lookup_icon(icon_name, size, 0) iconfilename = icon_info.get_filename() except: - icon_info = this_theme.lookup_icon(fallback_icon_name, size, 0) - iconfilename = icon_info.get_filename() + try: + icon_info = this_theme.lookup_icon(fallback_icon_name, size, 0) + iconfilename = icon_info.get_filename() + except: + # no icon in the current theme. Try a hard-coded fallback: + try: + # if debuglev 3 + print("Error: could not find default icon for",icon_name+", so using fallback.") + this_theme = Gtk.IconTheme.new() + this_theme.set_custom_theme("Numix-Circle") + icon_info = this_theme.lookup_icon(icon_name, size, 0) + iconfilename = icon_info.get_filename() + except: + print("Error: Could not find any icon for",icon_name) + return None #print(iconfilename) return Gtk.Image.new_from_pixbuf(Pixbuf.new_from_file_at_scale( filename=iconfilename, |