aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/signals/naughty.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/awesome/signals/naughty.lua')
-rw-r--r--.config/awesome/signals/naughty.lua54
1 files changed, 54 insertions, 0 deletions
diff --git a/.config/awesome/signals/naughty.lua b/.config/awesome/signals/naughty.lua
new file mode 100644
index 0000000..49187c0
--- /dev/null
+++ b/.config/awesome/signals/naughty.lua
@@ -0,0 +1,54 @@
+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)