Merge pull request #1536 from jmccrohan/naughty_icon_urldecode

naughty: urldecode icon URI file
This commit is contained in:
Emmanuel Lepage Vallée 2017-02-12 20:25:09 -05:00 committed by GitHub
commit 77c92d0d63
1 changed files with 2 additions and 0 deletions

View File

@ -626,6 +626,8 @@ function naughty.notify(args)
-- Is this really an URI instead of a path? -- Is this really an URI instead of a path?
if type(icon) == "string" and string.sub(icon, 1, 7) == "file://" then if type(icon) == "string" and string.sub(icon, 1, 7) == "file://" then
icon = string.sub(icon, 8) icon = string.sub(icon, 8)
-- urldecode URI path
icon = string.gsub(icon, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end )
end end
-- try to guess icon if the provided one is non-existent/readable -- try to guess icon if the provided one is non-existent/readable
if type(icon) == "string" and not util.file_readable(icon) then if type(icon) == "string" and not util.file_readable(icon) then