From e65ecb853b25ea1e6a2e96efc21456c6e5aad820 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 13 Apr 2014 12:22:24 +0200 Subject: [PATCH] naughty: Support file:// URIs for icon paths From the Desktop Notification Specification: 'The "app_icon" parameter and "image-path" hint should be either an URI (file:// is the only URI schema supported right now) or [...]' https://developer.gnome.org/notification-spec/#icons-and-images-formats Signed-off-by: Uli Schlachter --- lib/naughty.lua.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index f42cc6d79..c24a247f3 100644 --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -403,6 +403,10 @@ function naughty.notify(args) local iconmargin = nil local icon_w, icon_h = 0, 0 if icon then + -- Is this really an URI instead of a path? + if type(icon) == "string" and string.sub(icon, 1, 7) == "file://" then + icon = string.sub(icon, 8) + end -- try to guess icon if the provided one is non-existent/readable if type(icon) == "string" and not util.file_readable(icon) then icon = util.geticonpath(icon, naughty.config.icon_formats, naughty.config.icon_dirs, icon_size) or icon