awful.widget: add support for __call on ta{g,sk}list widgets
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
43902aed69
commit
fe35104bc2
|
@ -162,12 +162,12 @@ for s = 1, screen.count() do
|
||||||
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||||
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||||
-- Create a taglist widget
|
-- Create a taglist widget
|
||||||
mytaglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, mytaglist.buttons)
|
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
|
||||||
|
|
||||||
-- Create a tasklist widget
|
-- Create a tasklist widget
|
||||||
mytasklist[s] = awful.widget.tasklist.new(function(c)
|
mytasklist[s] = awful.widget.tasklist(function(c)
|
||||||
return awful.widget.tasklist.label.currenttags(c, s)
|
return awful.widget.tasklist.label.currenttags(c, s)
|
||||||
end, mytasklist.buttons)
|
end, mytasklist.buttons)
|
||||||
|
|
||||||
-- Create the wibox
|
-- Create the wibox
|
||||||
mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })
|
mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })
|
||||||
|
|
|
@ -11,6 +11,7 @@ local capi = { widget = widget,
|
||||||
client = client }
|
client = client }
|
||||||
local type = type
|
local type = type
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
local unpack = unpack
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
|
@ -169,4 +170,6 @@ function label.noempty(t, args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -10,6 +10,7 @@ local capi = { screen = screen,
|
||||||
client = client }
|
client = client }
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local setmetatable = setmetatable
|
local setmetatable = setmetatable
|
||||||
|
local unpack = unpack
|
||||||
local table = table
|
local table = table
|
||||||
local hooks = require("awful.hooks")
|
local hooks = require("awful.hooks")
|
||||||
local common = require("awful.widget.common")
|
local common = require("awful.widget.common")
|
||||||
|
@ -178,4 +179,6 @@ function label.currenttags(c, screen, args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
setmetatable(_M, { __call = function(_, ...) return new(unpack(arg)) end })
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue