Skip to content
Luke Bonham edited this page Jan 8, 2017 · 11 revisions

A Freedesktop.org-compliant applications menu.

Awesome 4.x branch

Usage

mymainmenu = freedesktop.menu.build(args) -- this is an awful.menu

The input variable args is a table and optional. It can contain 2 tables, before and after, which represent the entries to put before and after the retrieved ones.

Examples

Freedesktop entries only

mymainmenu = freedesktop.menu.build()

Freedesktop entries only

Integrated with default rc.lua

myawesomemenu = {
    { "hotkeys", function() return false, hotkeys_popup.show_help end },
    { "manual", terminal .. " -e man awesome" },
    { "edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile) },
    { "restart", awesome.restart },
    { "quit", function() awesome.quit() end }
}
mymainmenu = freedesktop.menu.build({
    before = {
        { "Awesome", myawesomemenu, beautiful.awesome_icon },
        -- other triads can be put here
    },
    after = {
        { "Open terminal", terminal },
        -- other triads can be put here
    }
})

Integrated in default rc.lua

Awesome 3.5.x branch

Usage

Just call build with no arguments to feed the items variable in your main awful.menu with your system applications. Examples:

-- freedesktop entries only
mymainmenu = awful.menu({ items = freedesktop.menu.build() })
-- integrated in default rc.lua definition
myawesomemenu = {
    { "hotkeys", function() return false, hotkeys_popup.show_help end },
    { "manual", terminal .. " -e man awesome" },
    { "edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile) },
    { "restart", awesome.restart },
    { "quit", function() awesome.quit() end }
}
mymainmenu = awful.menu({
    items = {
        { "awesome", myawesomemenu, beautiful.awesome_icon },
        { "applications", freedesktop.menu.build() },
        { "open terminal", terminal },
    }
})
Clone this wiki locally