Hi there,
   I'm attaching you a "freedesktop" package with the following modules:

- freedesktop.utils
  - able to parse all the .desktop files on a specified directory
- freedesktop.menu
  - able to return the Antonio freedesktop applications menu
- freedesktop.desktop
  - able to add to your awesome Desktop the icons related to the
.desktop files you have on your ~/Desktop dir

Although a bit rought, it works. Usage:

require("freedesktop.utils")
require("freedesktop.menu")
require("freedesktop.desktop")

myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "restart", awesome.restart },
   { "quit", awesome.quit }
}
menu_items = {}
table.foreach(
        freedesktop.menu.root_menu, function(i, submenu)
                table.insert(menu_items, submenu)
        end
)
table.insert(
        menu_items, {
        "awesome",
        myawesomemenu,
        beautiful.awesome_icon
})
mymainmenu = awful.menu.new({ items = menu_items, width = 150 })
mylauncher = awful.widget.launcher({
        image = beautiful.awesome_icon,
        menu = mymainmenu
})

for s = 1, screen.count() do
        freedesktop.desktop.add_desktop_icons(s)
end

Hope it can be further improved by you Lua gurus :)

__

Stefano Verna
http://www.stefanoverna.com

Julien Danjou wrote:
> Actually I did not write any code for that - I was just suggesting that
> it should be done first. And then build menu building module like yours,
> or a desktop in background.
> 
> Cheers,

Attachment: freedesktop.tar
Description: Unix tar archive

Reply via email to