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:
Julien Danjou 2009-05-08 11:59:38 +02:00
parent 43902aed69
commit fe35104bc2
3 changed files with 10 additions and 4 deletions

View File

@ -162,12 +162,12 @@ for s = 1, screen.count() do
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
-- 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
mytasklist[s] = awful.widget.tasklist.new(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end, mytasklist.buttons)
mytasklist[s] = awful.widget.tasklist(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end, mytasklist.buttons)
-- Create the wibox
mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })

View File

@ -11,6 +11,7 @@ local capi = { widget = widget,
client = client }
local type = type
local setmetatable = setmetatable
local unpack = unpack
local pairs = pairs
local ipairs = ipairs
local hooks = require("awful.hooks")
@ -169,4 +170,6 @@ function label.noempty(t, args)
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

View File

@ -10,6 +10,7 @@ local capi = { screen = screen,
client = client }
local ipairs = ipairs
local setmetatable = setmetatable
local unpack = unpack
local table = table
local hooks = require("awful.hooks")
local common = require("awful.widget.common")
@ -178,4 +179,6 @@ function label.currenttags(c, screen, args)
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