Ubuntu – How to add an item to the KDE Application Launcher Menu using the command line

kdekubuntu

I've added a file

/etc/xdg/menus/applications-merged/foo.menu

and the stuff in foo.menu all works in gnome. But the menu items didn't show up, even after rebooting.

I then tried adding a menu item "bogusmenu" using kmenuedit. After hitting Save in kmenuedit, bogusmenu appeared, and the menu item associated with foo.menu also showed up! So what's kmenuedit's secret updater code doing, and how can I call it from command line (specifically, an installation script)?

This is in Linux Educacional 4, which is based on Ubuntu 10.04 with KDE 4.4.5.

Some things which haven't worked:

  • Using xdg-desktop-menu, touching the files in /etc/xdg/menus, running kbuildsycoca.

Best Answer

OK, for me what worked was:

Take the applications-kmenuedit.menu file generated the first time you do a save inside KMenuEdit, clean up the "bogus" entry (or whatever change needed to get KMenuEdit to actually save a file there), and then copy that into either /etc/xdg/menus or ~/.config/menus. Magic file: bah!

Related Question