From b4b6e6c1fcc94814bed6587ba3e43be6baace3a5 Mon Sep 17 00:00:00 2001 From: Gino! Date: Fri, 11 Apr 2014 17:09:10 -0400 Subject: [PATCH] Fix Icon Finding in awful.util This should also fix naughty failures to display the correct icons --- lib/awful/util.lua.in | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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