awesomewm/modules/launcher/widget.lua

49 lines
1.1 KiB
Lua
Raw Normal View History

2022-07-16 16:20:58 -07:00
local launcher = req_rel(..., "util")
2021-08-01 07:24:26 -07:00
local widget = {}
widget.icon = wibox.widget {
resize = true,
2023-08-23 09:38:40 -07:00
image = beautiful.icons[config.launcher.icon],
2021-08-01 07:24:26 -07:00
widget = wibox.widget.imagebox
}
widget.widget = wibox.widget {
{
{ -- Right space
widget = wibox.widget.separator,
color = beautiful.color.transparent,
forced_width = beautiful.dpi(3)
},
{
widget.icon,
top = beautiful.dpi(2),
bottom = beautiful.dpi(2),
layout = wibox.container.margin,
},
{ -- Left space
widget = wibox.widget.separator,
color = beautiful.color.transparent,
forced_width = beautiful.dpi(3)
},
layout = wibox.layout.align.horizontal,
},
layout = wibox.container.background,
}
widget.widget:connect_signal("mouse::enter", function(result)
widget.widget.bg = beautiful.color.bar.hover_bg
end)
widget.widget:connect_signal("mouse::leave", function(result)
widget.widget.bg = beautiful.color.transparent
end)
widget.widget:connect_signal("button::press",
function(_, _, _, button, mods)
if (button == 1) then
2022-07-16 16:20:58 -07:00
launcher.launcher()
2021-08-01 07:24:26 -07:00
end
end
)
2022-07-16 16:20:58 -07:00
return widget