diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in index 1d35f2fb2..123c4a64c 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