From 8530b170997a8138c655452ec7a73ec56a805869 Mon Sep 17 00:00:00 2001 From: Ksaper Date: Thu, 16 Feb 2023 03:19:05 +0200 Subject: [PATCH] Nemo WM_CLASS='nemo' while it's desktop name prop='Files', but hey at least I can match by id --- helpers/icon_theme.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/helpers/icon_theme.lua b/helpers/icon_theme.lua index af51259..22a7a66 100644 --- a/helpers/icon_theme.lua +++ b/helpers/icon_theme.lua @@ -90,18 +90,21 @@ function _icon_theme.get_client_icon_path(client, icon_theme, icon_size) local desktop_app_info = DesktopAppInfo.new(id) if desktop_app_info then local props = { - string.lower(desktop_app_info:get_string("Name") or ""), - string.lower(desktop_app_info:get_filename() or ""), - string.lower(desktop_app_info:get_startup_wm_class() or ""), - string.lower(desktop_app_info:get_string("Icon") or ""), - string.lower(desktop_app_info:get_string("Exec") or ""), - string.lower(desktop_app_info:get_string("Keywords") or "") + id:gsub(".desktop", ""), + desktop_app_info:get_string("Name"), + desktop_app_info:get_filename(), + desktop_app_info:get_startup_wm_class(), + desktop_app_info:get_string("Icon"), + desktop_app_info:get_string("Exec"), + desktop_app_info:get_string("Keywords") } for _, prop in ipairs(props) do - if prop ~= "" and (prop == class or prop == name) then + if prop ~= nil and (prop:lower() == class or prop:lower() == name) then local icon = desktop_app_info:get_string("Icon") - return _icon_theme.get_icon_path(icon, icon_theme, icon_size) + if icon ~= nil then + return _icon_theme.get_icon_path(icon, icon_theme, icon_size) + end end end end