diff options
author | delta <darkussdelta@gmail.com> | 2023-04-04 15:43:40 +0200 |
---|---|---|
committer | delta <darkussdelta@gmail.com> | 2023-04-04 15:43:40 +0200 |
commit | f7116d268aff3fae88d8de408e8c807295618a5c (patch) | |
tree | 6f52530d5799769e6af7c63bc5108f16f9aff742 /.config/awesome/signals/naughty.lua | |
parent | f0b32f45746c026d402651013b7e98315d6956a1 (diff) |
restructure and improve config
Diffstat (limited to '.config/awesome/signals/naughty.lua')
-rw-r--r-- | .config/awesome/signals/naughty.lua | 54 |
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) |