Hey this works for me, can someone please test/merge?

I also think something like the string below is needed, not sure where
though.. this way whatever icon theme you specify in beautiful would be
used..

naughty.config.icon_dirs = { "~/.icons/" , "/usr/share/icons/hicolor/",
"/usr/share/pixmaps/", "/usr/share/icons/" .. beautiful.icon_theme  .."/"}

Let me know

I can also do a github merge request if thats easier...

Harvey
diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in
index 1d35f2f..123c4a6 100644
--- a/lib/awful/util.lua.in
+++ b/lib/awful/util.lua.in
@@ -185,21 +185,24 @@ end
 --             of the dirs are searched first
 function util.geticonpath(iconname, exts, dirs, size)
     exts = exts or { 'png', 'gif' }
-    dirs = dirs or { '/usr/share/pixmaps/' }
+    dirs = dirs or { '/usr/share/pixmaps/', '/usr/share/icons/hicolor/' }
+    icontypes = { 'apps', 'actions',  'categories',  'emblems',
+    'mimetypes',  'status', 'devices', 'extras', 'places', 'stock' }
     for _, d in pairs(dirs) do
+        local icon
         for _, e in pairs(exts) do
-            local icon
-            if size then
-                icon = string.format("%s%ux%u/%s.%s",
-                       d, size, size, iconname, e)
-                if util.file_readable(icon) then
-                    return icon
-                end
-            end
             icon = d .. iconname .. '.' .. e
             if util.file_readable(icon) then
                 return icon
             end
+            if size then
+                for _, t in pairs(icontypes) do
+                    icon = string.format("%s%ux%u/%s/%s.%s", d, size, size, t, iconname, e)
+                    if util.file_readable(icon) then
+                        return icon
+                    end
+                end
+            end
         end
     end
 end
diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in
index f42cc6d..f7cb915 100644
--- a/lib/naughty.lua.in
+++ b/lib/naughty.lua.in
@@ -38,8 +38,8 @@ naughty.config.padding = 4
 --- Spacing between popups. Default: 1
 naughty.config.spacing = 1
 --- List of directories that will be checked by getIcon()
---   Default: { "/usr/share/pixmaps/", }
-naughty.config.icon_dirs = { "/usr/share/pixmaps/", }
+--   Default: { "/usr/share/pixmaps/", "/usr/share/icons/pixmaps/" }
+naughty.config.icon_dirs = { "/usr/share/pixmaps/", "/usr/share/icons/hicolor/" }
 --- List of formats that will be checked by getIcon()
 --   Default: { "png", "gif" }
 naughty.config.icon_formats = { "png", "gif" }

Reply via email to