33 lines
604 B
Lua
33 lines
604 B
Lua
local amenu = require "awful.menu"
|
|
|
|
local configuration = {
|
|
menu = require "rc.configuration.menu",
|
|
}
|
|
|
|
local mymainmenu = { _private = {}, mt = {} }
|
|
|
|
function mymainmenu:instance()
|
|
local instance = self._private.instance
|
|
|
|
if not instance then
|
|
instance = mymainmenu.new()
|
|
self._private.instance = instance
|
|
end
|
|
|
|
return instance
|
|
end
|
|
|
|
function mymainmenu.new()
|
|
local menu = amenu {
|
|
items = configuration.menu.mymainmenu,
|
|
}
|
|
|
|
return menu
|
|
end
|
|
|
|
function mymainmenu.mt:__call()
|
|
return self:instance()
|
|
end
|
|
|
|
return setmetatable(mymainmenu, mymainmenu.mt)
|