From 18e96e360d21addb04babbe04a0204c719a591f8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 15 Jul 2009 15:57:31 +0200 Subject: [PATCH] awful.menu: add __call on module Signed-off-by: Julien Danjou --- awesomerc.lua.in | 8 ++++---- lib/awful/menu.lua.in | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 53ae46f52..fb3b25e38 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -102,10 +102,10 @@ myawesomemenu = { { "quit", awesome.quit } } -mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal } - } - }) +mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal } + } + }) mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), menu = mymainmenu }) diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in index 9f8f40afe..1c6f60548 100644 --- a/lib/awful/menu.lua.in +++ b/lib/awful/menu.lua.in @@ -9,6 +9,7 @@ local pairs = pairs local table = table local type = type +local setmetatable = setmetatable local wibox = wibox local image = image local widget = widget @@ -369,3 +370,7 @@ function new(menu, parent, num) return data end + +setmetatable(_M, { __call = function(_, ...) return new(...) end }) + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80