aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/components/signals/naughty.lua
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2023-01-29 09:59:52 +0100
committerdelta <darkussdelta@gmail.com>2023-01-29 10:02:22 +0100
commita0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 (patch)
tree04500ca0a4c97f85b1a2d875d8285effda7b57fe /.config/awesome/components/signals/naughty.lua
init dots
Diffstat (limited to '.config/awesome/components/signals/naughty.lua')
-rw-r--r--.config/awesome/components/signals/naughty.lua64
1 files changed, 64 insertions, 0 deletions
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)