awesomerc/ui/menu/mymainmenu.lua

33 lines
604 B
Lua
Raw Normal View History

2021-11-29 18:53:23 +01:00
local amenu = require "awful.menu"
2021-05-25 17:37:29 +02:00
local configuration = {
2021-11-29 18:53:23 +01:00
menu = require "rc.configuration.menu",
2021-05-25 17:37:29 +02:00
}
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
2021-11-29 18:53:23 +01:00
function mymainmenu.new()
2021-05-25 17:37:29 +02:00
local menu = amenu {
2021-11-29 18:53:23 +01:00
items = configuration.menu.mymainmenu,
2021-05-25 17:37:29 +02:00
}
return menu
end
function mymainmenu.mt:__call()
return self:instance()
end
return setmetatable(mymainmenu, mymainmenu.mt)