On Wed, May 11, 2011 at 10:12 AM, Perry Hargrave <[email protected]> wrote: > On Wed, May 11, 2011 at 12:01 AM, Zsolt Udvari <[email protected]> wrote: >>> That is definitely not true. Whatever function you use to generate >>> menus is called when the menu is opened. >> And if you've created a menu (e.g. "main menu"), and you will install >> an application and want insert into "main menu", how can do this? Is >> it possible? Or only a workaround: delete the "main menu" and >> re-create? >> >> Zsolt >> > Don't create a 'main menu'. Create a function that returns a 'main menu' > > Then your f_main_menu() is called by your button that opens the menu. > > I don't do this for applications, but the concept is similar for tags, > especially note how button 3 is used to call a function, > 'menu_taglist'.
So for applications what you could do is either parse /usr/share/applications (probably lots of junk) or you could parse .desktop files in ~/.config/applications. Drop only the .desktop files you want in there, have your f_main_menu() function read the contents of that directory and voila... If you really want to re-invent the wheel (to avoid parsing .desktop files) you could just put a applications.lua file in ~/.config/awesome and have your f_main_menu() function load that with each call... the possibilities are really endless. -- p -- To unsubscribe, send mail to [email protected].
