70 lines
2.3 KiB
Lua
70 lines
2.3 KiB
Lua
|
local awful = require("awful")
|
||
|
local gears = require("gears")
|
||
|
local awmtk2 = require("awmtk2")
|
||
|
local wibox = require("wibox")
|
||
|
local beautiful = require("beautiful")
|
||
|
|
||
|
return function(args)
|
||
|
local style = awmtk2.create_style("applications_tab",
|
||
|
awmtk2.generic.menu, args.style, args.vertical)
|
||
|
local templates = awmtk2.create_template_lib("applications_tab",
|
||
|
awmtk2.templates,args.templates)
|
||
|
local t = awmtk2.build_templates(templates,style,args.vertical)
|
||
|
local widget = wibox.widget({
|
||
|
{
|
||
|
t.center(t.container(t.container({
|
||
|
widget = wibox.widget.textbox,
|
||
|
markup = "Search area",
|
||
|
id = "searchtext"
|
||
|
},{
|
||
|
id = "searchbox",
|
||
|
bg = style.container.bg_highlight,
|
||
|
forced_width = 240
|
||
|
})
|
||
|
)),
|
||
|
{
|
||
|
{
|
||
|
layout = wibox.layout.grid,
|
||
|
forced_num_cols = args.columns or 4,
|
||
|
homogenous = true,
|
||
|
expand = true,
|
||
|
orientation = "veritcal",
|
||
|
spacing = style.base.spacing,
|
||
|
id = "appgrid"
|
||
|
},
|
||
|
margins = 20,
|
||
|
widget = wibox.container.margin
|
||
|
},
|
||
|
layout = wibox.layout.fixed.vertical,
|
||
|
spacing = style.base.spacing,
|
||
|
id = "root_ratio"
|
||
|
},
|
||
|
widget = wibox.container.margin,
|
||
|
margins = 20
|
||
|
})
|
||
|
local appgrid = widget:get_children_by_id("appgrid")[1]
|
||
|
local gen_icon = function(appdata)
|
||
|
local appicon = wibox.widget({
|
||
|
t.icon({
|
||
|
image = appdata.icon or beautiful.icon_default,
|
||
|
}),
|
||
|
{
|
||
|
markup = appdata.title,
|
||
|
widget = wibox.widget.textbox,
|
||
|
align = "center"
|
||
|
},
|
||
|
spacing = style.base.spacing,
|
||
|
layout = wibox.layout.fixed.vertical
|
||
|
})
|
||
|
appicon:connect_signal("button::press",function(_,_,_,button)
|
||
|
if button == 1 then
|
||
|
awful.spawn(appdata.exec)
|
||
|
end
|
||
|
end)
|
||
|
return appicon
|
||
|
end
|
||
|
awesome.connect_signal("xdg::all_finished",function()
|
||
|
end)
|
||
|
return widget
|
||
|
end
|