dots/.config/awesome/ui/wicked/init.lua

98 lines
2.9 KiB
Lua

local awful = require "awful"
local qvars = require "quarrel.vars"
local wibox = require "wibox"
local debug = require "gears.debug"
local gtimer = require "gears.timer"
local naughty = require "naughty"
-- local rubato = require "lib.rubato"
local default = require "ui.wicked._default"
local qui = require "quarrel.ui"
local wicked = {}
wicked._active_notififcations = {}
function wicked:notify(n)
-- local notif = wibox.widget {
local notif = qui.popup {
-- widget = {
-- {
-- {
-- widget = naughty.widget.icon,
-- notification = n,
-- forced_height = 0,
-- forced_width = 0,
-- clip_shape = qvars.shape,
-- id = "icon_role"
-- },
-- {
-- {
-- widget = naughty.widget.title,
-- notification = n
-- },
-- {
-- widget = naughty.widget.message,
-- notification = n
-- },
-- layout = wibox.layout.fixed.vertical
-- },
-- layout = wibox.layout.fixed.horizontal,
-- spacing = qvars.padding
-- },
-- widget = wibox.container.margin,
-- margins = qvars.padding
-- },
widget = {
-- {
{
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 = 4,
layout = wibox.layout.fixed.horizontal
-- },
-- actionlist,
-- spacing = 10,
-- layout = wibox.layout.fixed.vertical,
},
placement = awful.placement.centered,
ontop = true
}
gtimer {
timeout = qvars.notif_timeout,
autostart = true,
callback = function()
notif.visible = false
notif = nil
end
}
-- local icon = notif.widget:get_children_by_id("icon_role")[1]
-- if n.image then
-- icon.forced_height = dpi(32)
-- icon.forced_width = dpi(32)
-- end
end
return wicked