dots/.config/awesome/signals/naughty.lua

55 lines
1.7 KiB
Lua

local naughty = require "naughty"
local awful = require "awful"
local beautiful = require "beautiful"
local wibox = require "wibox"
local qvars = require "quarrel.vars"
naughty.connect_signal("request::display", function(n)
naughty.layout.box {
notification = n,
placement = function(d)
return awful.placement.right(d, {
margins = beautiful.useless_gap * 2
})
end,
widget_template = {
widget = wibox.container.margin,
margins = qvars.big_padding,
{
{
widget = naughty.widget.icon,
notification = n
},
{
widget = wibox.container.place,
valign = "center",
halign = "center",
{
{
widget = naughty.widget.title,
notification = n
},
{
widget = naughty.widget.message,
notification = n
},
-- spacing = 4,
layout = wibox.layout.fixed.vertical,
}
},
fill_space = true,
spacing = n.icon and qvars.big_padding or 0,
layout = wibox.layout.fixed.horizontal
}
}
}
end)
naughty.connect_signal("request::display_error", function(message, startup)
naughty.notification {
urgency = "critical",
title = "Oops, an error happened"..(startup and " during startup!" or "!"),
message = message
}
end)