summaryrefslogtreecommitdiff
blob: 588f9ab9ec5202ef76dd13d9adec129b1acbcd11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From: Uli Schlachter <psychon@znc.in>
Date: Sat, 12 Apr 2014 14:15:11 +0000 (+0200)
Subject: Merge git://github.com/Teknocrat/awesome
X-Git-Url: http://git.naquadah.org/?p=awesome.git;a=commitdiff_plain;h=d76d3e0b6a00b8b289b3801ba197e0dae732a92d;hp=1090719d677c86e90a1394a34f0effb418728493

Merge git://github.com/Teknocrat/awesome
---

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