diff --git a/config/awesome/notifications/init.lua b/config/awesome/notifications/init.lua index 455d75d..9ee2095 100644 --- a/config/awesome/notifications/init.lua +++ b/config/awesome/notifications/init.lua @@ -1,6 +1,7 @@ local beautiful = require("beautiful") local naughty = require("naughty") local helpers = require("helpers") +local menubar = require("menubar") notifications = {} @@ -79,6 +80,25 @@ function notifications.init(theme_name) require("notifications.themes." .. theme_name) end +-- Handle notification icon +naughty.connect_signal("request::icon", function(n, context, hints) + -- Handle other contexts here + if context ~= "app_icon" then return end + + -- Use XDG icon + local path = menubar.utils.lookup_icon(hints.app_icon) or + menubar.utils.lookup_icon(hints.app_icon:lower()) + + if path then + n.icon = path + end +end) + +-- Use XDG icon +naughty.connect_signal("request::action_icon", function(a, context, hints) + a.icon = menubar.utils.lookup_icon(hints.id) +end) + -- Initialize various notification daemons require("notifications.volume") require("notifications.brightness")