From a0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 Mon Sep 17 00:00:00 2001 From: delta Date: Sun, 29 Jan 2023 09:59:52 +0100 Subject: init dots --- .config/awesome/components/signals/naughty.lua | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .config/awesome/components/signals/naughty.lua (limited to '.config/awesome/components/signals/naughty.lua') diff --git a/.config/awesome/components/signals/naughty.lua b/.config/awesome/components/signals/naughty.lua new file mode 100644 index 0000000..bab4712 --- /dev/null +++ b/.config/awesome/components/signals/naughty.lua @@ -0,0 +1,64 @@ +local awful = require "awful" +local vars = require "themes.prismite.vars" +local wibox = require "wibox" +local naughty = require "naughty" +local xresources = require "beautiful.xresources" +local dpi = xresources.apply_dpi + +function build_notification(n) + + + local popup = awful.popup { + widget = { + { + { + widget = naughty.widget.icon, + image = n.image, + forced_height = 64, + forced_width = 64, + clip_shape = vars.shape + }, + { + { + widget = wibox.widget.textbox, + text = n.title + }, + { + widget = wibox.widget.textbox, + text = n.message + }, + layout = wibox.layout.fixed.vertical + }, + layout = wibox.layout.fixed.horizontal + }, + widget = wibox.container.margin, + margins = dpi(4) + }, + border_color = vars.colors.bright.black, + border_width = vars.border_width, + ontop = true, + placement = function(d) + return awful.placement.bottom_right(d, { + honor_padding = true + }) + end, + bg = vars.colors.bg, + shape = vars.shape, + } + + -- popup.y = screen[1].tiling_area.height - - dpi(4) +end + +-- naughty.connect_signal("request::display", build_notification) + +naughty.connect_signal("request::display", function(n) + naughty.layout.box { notification = n } +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) -- cgit v1.2.3