From fe35104bc21692f9f89aeff24d0dd8a9c0309dff Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 8 May 2009 11:59:38 +0200 Subject: [PATCH] awful.widget: add support for __call on ta{g,sk}list widgets Signed-off-by: Julien Danjou --- awesomerc.lua.in | 8 ++++---- lib/awful/widget/taglist.lua.in | 3 +++ lib/awful/widget/tasklist.lua.in | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index c8f32d99..9f922942 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -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 }) diff --git a/lib/awful/widget/taglist.lua.in b/lib/awful/widget/taglist.lua.in index 48d619dc..0a631bcc 100644 --- a/lib/awful/widget/taglist.lua.in +++ b/lib/awful/widget/taglist.lua.in @@ -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 diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in index 221e40b6..514399ad 100644 --- a/lib/awful/widget/tasklist.lua.in +++ b/lib/awful/widget/tasklist.lua.in @@ -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