From 8fc698f46d18e7776860b4987974d4b67e41afa3 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Sat, 28 Jan 2023 17:06:31 -0600 Subject: [PATCH] Added filters section to config file --- .../windows/tabs/icons/mixins/desktopiconmixin.py | 12 +++++++++++- src/user_config/shellfm/settings.json | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shellfm/windows/tabs/icons/mixins/desktopiconmixin.py b/src/shellfm/windows/tabs/icons/mixins/desktopiconmixin.py index 3ee2a50..93105fb 100644 --- a/src/shellfm/windows/tabs/icons/mixins/desktopiconmixin.py +++ b/src/shellfm/windows/tabs/icons/mixins/desktopiconmixin.py @@ -3,6 +3,11 @@ import os, subprocess, hashlib from os.path import isfile # Gtk imports +import gi +gi.require_version('Gtk', '3.0') + +from gi.repository import Gtk +from gi.repository import Gio # Application imports from .xdg.DesktopEntry import DesktopEntry @@ -36,8 +41,13 @@ class DesktopIconMixin: elif os.path.exists(icon): return self.create_scaled_image(icon, self.sys_icon_wh) else: - alt_icon_path = "" + gio_icon = Gio.Icon.new_for_string(icon) + gicon = Gtk.Image.new_from_gicon(gio_icon, 32) + pixbuf = gicon.get_pixbuf() + if pixbuf: + return pixbuf + alt_icon_path = "" for dir in self.ICON_DIRS: alt_icon_path = self.traverse_icons_folder(dir, icon) if alt_icon_path != "": diff --git a/src/user_config/shellfm/settings.json b/src/user_config/shellfm/settings.json index 456e804..1428f6f 100644 --- a/src/user_config/shellfm/settings.json +++ b/src/user_config/shellfm/settings.json @@ -23,6 +23,7 @@ "remux_folder_max_disk_usage": "8589934592" }, "filters": { + "meshs": [".blend", ".dae", ".fbx", ".gltf", ".obj", ".stl"], "code": [".cpp", ".css", ".c", ".go", ".html", ".htm", ".java", ".js", ".json", ".lua", ".md", ".py", ".rs"], "videos": [".mkv", ".mp4", ".webm", ".avi", ".mov", ".m4v", ".mpg", ".mpeg", ".wmv", ".flv"], "office": [".doc", ".docx", ".xls", ".xlsx", ".xlt", ".xltx", ".xlm", ".ppt", ".pptx", ".pps", ".ppsx", ".odt", ".rtf"],