Added widget classification
This commit is contained in:
parent
92aed20ebb
commit
688c01afc1
|
@ -421,5 +421,6 @@ awmtk.generic.iconified_widget = awmtk.create_style("generic_iconified_widget",a
|
||||||
awmtk.generic.status_widget = awmtk.create_style("generic_status_widget",awmtk.default,{})
|
awmtk.generic.status_widget = awmtk.create_style("generic_status_widget",awmtk.default,{})
|
||||||
awmtk.generic.oneline_widget = awmtk.create_style("generic_oneline_widget",awmtk.default,{})
|
awmtk.generic.oneline_widget = awmtk.create_style("generic_oneline_widget",awmtk.default,{})
|
||||||
awmtk.generic.composite_widget = awmtk.create_style("generic_composite_widget",awmtk.default,{})
|
awmtk.generic.composite_widget = awmtk.create_style("generic_composite_widget",awmtk.default,{})
|
||||||
|
awmtk.generic.popup = awmtk.create_style("generic_popup",awmtk.default,{})
|
||||||
-- }}}
|
-- }}}
|
||||||
return awmtk
|
return awmtk
|
||||||
|
|
|
@ -48,7 +48,7 @@ end -- }}}
|
||||||
|
|
||||||
do --{{{ Screen
|
do --{{{ Screen
|
||||||
local wibar_config = {}
|
local wibar_config = {}
|
||||||
local style = awmtk2.create_style("wibar",awmtk2.default,{})
|
local style = awmtk2.create_style("wibar",awmtk2.generic.composite_widget,{})
|
||||||
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
|
for k,v in pairs({"wibar_top","wibar_bottom","wibar_left","wibar_right"}) do
|
||||||
style[v] = awmtk2.create_delta(v, {},
|
style[v] = awmtk2.create_delta(v, {},
|
||||||
(beautiful.widgets and beautiful.widgets.wibar) or {},
|
(beautiful.widgets and beautiful.widgets.wibar) or {},
|
||||||
|
@ -94,7 +94,7 @@ end -- }}}
|
||||||
|
|
||||||
do -- {{{ Titlebars
|
do -- {{{ Titlebars
|
||||||
local titlebar_config = {}
|
local titlebar_config = {}
|
||||||
local style = awmtk2.create_style("titlebar",awmtk2.default,{})
|
local style = awmtk2.create_style("titlebar",awmtk2.generic.composite_widget,{})
|
||||||
for k,v in pairs({"titlebar_top","titlebar_left","titlebar_right","titlebar_bottom"}) do
|
for k,v in pairs({"titlebar_top","titlebar_left","titlebar_right","titlebar_bottom"}) do
|
||||||
-- Create styles for each titlebar
|
-- Create styles for each titlebar
|
||||||
style[v] = awmtk2.create_delta(v, {},
|
style[v] = awmtk2.create_delta(v, {},
|
||||||
|
|
|
@ -13,7 +13,8 @@ local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("popuptitle",awmtk2.default,args.style)
|
local style = awmtk2.create_style("popuptitle",
|
||||||
|
awmtk2.generic.oneline_widget,args.style)
|
||||||
local templates = awmtk2.create_template_lib("popuptitle",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("popuptitle",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local widget = wibox.widget(t.container(t.article({
|
local widget = wibox.widget(t.container(t.article({
|
||||||
|
|
|
@ -13,7 +13,8 @@ local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("subpanel",awmtk2.default,args.style)
|
local style = awmtk2.create_style("subpanel",
|
||||||
|
awmtk2.generic.composite_widget,args.style)
|
||||||
local templates = awmtk2.create_template_lib("subpanel",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("subpanel",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local widget = wibox.widget(t.container(args.layout))
|
local widget = wibox.widget(t.container(args.layout))
|
||||||
|
|
|
@ -13,7 +13,8 @@ local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("taglist",awmtk2.default,args.style)
|
local style = awmtk2.create_style("taglist",
|
||||||
|
awmtk2.generic.oneline_widget,args.style)
|
||||||
local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("taglist",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local widget = wibox.widget(t.container(awful.widget.taglist({
|
local widget = wibox.widget(t.container(awful.widget.taglist({
|
||||||
|
|
|
@ -42,7 +42,7 @@ end
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("battery",
|
local style = awmtk2.create_style("battery",
|
||||||
awmtk2.generic.status_widget,args.style)
|
awmtk2.generic.popup,args.style)
|
||||||
local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
-- set up popup layout
|
-- set up popup layout
|
||||||
|
@ -52,8 +52,13 @@ return function(args)
|
||||||
})
|
})
|
||||||
-- create popup
|
-- create popup
|
||||||
local popup = awful.popup(t.popup(layout))
|
local popup = awful.popup(t.popup(layout))
|
||||||
-- create battery widget
|
local battery_widget
|
||||||
local battery_widget = wibox.widget(t.button({
|
do -- create battery widget
|
||||||
|
local style = awmtk2.create_style("battery",
|
||||||
|
awmtk2.generic.status_widget,args.style)
|
||||||
|
local templates = awmtk2.create_template_lib("battery",awmtk2.templates,args.templates)
|
||||||
|
local t = awmtk2.build_templates(templates,style)
|
||||||
|
battery_widget = wibox.widget(t.button({
|
||||||
{
|
{
|
||||||
image = beautiful["battery-missing-symbolic"],
|
image = beautiful["battery-missing-symbolic"],
|
||||||
resize = true,
|
resize = true,
|
||||||
|
@ -79,7 +84,7 @@ return function(args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
-- map widgets to their names to make it easier to update separate components
|
-- map widgets to their names to make it easier to update separate components
|
||||||
local widget_map = {}
|
local widget_map = {}
|
||||||
-- also map current charge state of every device to get the icon for the tray
|
-- also map current charge state of every device to get the icon for the tray
|
||||||
|
|
|
@ -14,7 +14,7 @@ local beautiful = require("beautiful")
|
||||||
local menugen = require("context_menu")
|
local menugen = require("context_menu")
|
||||||
local builder = require("builder")
|
local builder = require("builder")
|
||||||
local style = awmtk2.create_style("client_menu",
|
local style = awmtk2.create_style("client_menu",
|
||||||
awmtk2.generic.menu,{})
|
awmtk2.generic.composite_widget,{})
|
||||||
local templates = awmtk2.create_template_lib("client_menu",awmtk2.templates,{})
|
local templates = awmtk2.create_template_lib("client_menu",awmtk2.templates,{})
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,8 @@ local xdg_search = function(name,rlimit)
|
||||||
end
|
end
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("dismal",awmtk2.default,args.style)
|
local style = awmtk2.create_style("dismal",
|
||||||
|
awmtk2.generic.popup,args.style)
|
||||||
local templates = awmtk2.create_template_lib("dismal",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("dismal",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local launchpad = awful.popup(t.popup({
|
local launchpad = awful.popup(t.popup({
|
||||||
|
|
|
@ -16,7 +16,8 @@ local DateTime = glib.DateTime
|
||||||
local TimeZone = glib.TimeZone
|
local TimeZone = glib.TimeZone
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("lock_clock",awmtk2.default,args.style)
|
local style = awmtk2.create_style("lock_clock",
|
||||||
|
awmtk2.generic.status_widget,args.style)
|
||||||
local templates = awmtk2.create_template_lib("lock_clock",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("lock_clock",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
-- Don't mind me just stealing default library code
|
-- Don't mind me just stealing default library code
|
||||||
|
|
|
@ -31,7 +31,8 @@ local function _preload(args)
|
||||||
do -- {{{ Lock bar
|
do -- {{{ Lock bar
|
||||||
local config_path = root_path.."/themes/"..global.theme.."/config/lockbar.json"
|
local config_path = root_path.."/themes/"..global.theme.."/config/lockbar.json"
|
||||||
if readable(config_path) then
|
if readable(config_path) then
|
||||||
local style = awmtk2.create_style("lockbar", awmtk2.default, args.style)
|
local style = awmtk2.create_style("lockbar",
|
||||||
|
awmtk2.generic.composite_widget, args.style)
|
||||||
local templates = awmtk2.create_template_lib("lockbar",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("lockbar",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local config_file = io.open(config_path,"r")
|
local config_file = io.open(config_path,"r")
|
||||||
|
@ -50,7 +51,8 @@ local function _preload(args)
|
||||||
end
|
end
|
||||||
end -- }}}
|
end -- }}}
|
||||||
do -- {{{ Lock widget
|
do -- {{{ Lock widget
|
||||||
local style = awmtk2.create_style("lockpanel", awmtk2.default, args.style)
|
local style = awmtk2.create_style("lockpanel",
|
||||||
|
awmtk2.generic.composite_widget, args.style)
|
||||||
local templates = awmtk2.create_template_lib("lockpanel",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("lockpanel",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local config_path = root_path.."/themes/"..global.theme.."/config/lockpanel.json"
|
local config_path = root_path.."/themes/"..global.theme.."/config/lockpanel.json"
|
||||||
|
|
|
@ -16,7 +16,7 @@ local naughty = require("naughty")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("notifications",
|
local style = awmtk2.create_style("notifications",
|
||||||
awmtk2.generic.iconified_widget,args.style)
|
awmtk2.generic.popup,args.style)
|
||||||
local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local layout = wibox.widget({
|
local layout = wibox.widget({
|
||||||
|
@ -82,7 +82,13 @@ return function(args)
|
||||||
return update_args
|
return update_args
|
||||||
end
|
end
|
||||||
-- create popup button
|
-- create popup button
|
||||||
local clip_widget = wibox.widget(t.button({
|
local clip_widget
|
||||||
|
do
|
||||||
|
local style = awmtk2.create_style("notifications",
|
||||||
|
awmtk2.generic.iconified_widget,args.style)
|
||||||
|
local templates = awmtk2.create_template_lib("notifications",awmtk2.templates,args.templates)
|
||||||
|
local t = awmtk2.build_templates(templates,style)
|
||||||
|
clip_widget = wibox.widget(t.button({
|
||||||
image = beautiful["notifications-area-symbolic"],
|
image = beautiful["notifications-area-symbolic"],
|
||||||
resize = true,
|
resize = true,
|
||||||
widget = wibox.widget.imagebox,
|
widget = wibox.widget.imagebox,
|
||||||
|
@ -97,5 +103,6 @@ return function(args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
return clip_widget
|
return clip_widget
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ local builder = require("builder")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("root_menu",
|
local style = awmtk2.create_style("root_menu",
|
||||||
awmtk2.generic.menu,{})
|
awmtk2.generic.composite_widget,{})
|
||||||
local templates = awmtk2.create_template_lib("root_menu",awmtk2.templates,{})
|
local templates = awmtk2.create_template_lib("root_menu",awmtk2.templates,{})
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local config_file = io.open(root_path.."/themes/"..global.theme.."/config/root_menu.json","r")
|
local config_file = io.open(root_path.."/themes/"..global.theme.."/config/root_menu.json","r")
|
||||||
|
|
|
@ -14,7 +14,8 @@ local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("soundclown",awmtk2.default,args.style)
|
local style = awmtk2.create_style("soundclown",
|
||||||
|
awmtk2.generic.oneline_widget,args.style)
|
||||||
local templates = awmtk2.create_template_lib("soundclown",awmtk2.templates,args.templates)
|
local templates = awmtk2.create_template_lib("soundclown",awmtk2.templates,args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local test = os.execute("mpc help")
|
local test = os.execute("mpc help")
|
||||||
|
|
|
@ -31,7 +31,8 @@ local tasklist_buttons = gears.table.join(
|
||||||
)
|
)
|
||||||
|
|
||||||
return function(args)
|
return function(args)
|
||||||
local style = awmtk2.create_style("tasklist", awmtk2.default, args.style)
|
local style = awmtk2.create_style("tasklist",
|
||||||
|
awmtk2.generic.oneline_widget, args.style)
|
||||||
local templates = awmtk2.create_template_lib("tasklist", awmtk2.templates, args.templates)
|
local templates = awmtk2.create_template_lib("tasklist", awmtk2.templates, args.templates)
|
||||||
local t = awmtk2.build_templates(templates,style)
|
local t = awmtk2.build_templates(templates,style)
|
||||||
local button = t.button({
|
local button = t.button({
|
||||||
|
|
Loading…
Reference in New Issue