This can be done easily by creating a .desktop file for each application you would like to add to the menu. This is all explained clearly in the LXDE wiki for the main menu1.
*.desktop Locations
If you want the application to appear in menus for all users on a system, add the file to the directory /usr/share/applications/. For example, you may have /usr/share/applications/gimp.desktop for the gimp application. This is where packages normally create their .desktop files and is recommended.
If you want to add the application to a the menu of a specific user, create the file in the directory $HOME/.local/share/applications/.
*.desktop Settings
Read some of your existing .desktop files in /usr/share/applications/ to get an understanding of how they work. They are fairly straightforward, but the wiki provides a brief explanation of commonly used settings.
Here is a slightly modified explanation from the wiki for the warsow.desktop file. The actual settings are in bold font.
- [Desktop Entry] - indicates that this file is a *.desktop file
- Encoding=UTF-8 - UTF-8 encoding is used
- Exec=warsow - path of a binary or script used to start the programm
- Icon=/home/USER/my/icons/wsw-icon_80x80.png - path to the icon for the entry
- Type=Application - desktop file is starting an application
- Terminal=false - the program will not run in a terminal
- Name=Warsow - displayed name in the menu
- GenericName=warsow - description of the entry
- StartupNotify=false - Startup notification is turned off
- Categories=Game - specifies the categories in which the entry will be
placed in the menu (several categories are specified with a semicolon
between them, e.g. 'Game;Education')
Adding An Application to an Application Launch Bar
If you have created a .desktop file or one was created when the application is installed, you can add the application to a launch bar inside a lxpanel. The configurations for panels are located in the profile directory. For example, one of your panels may be at $HOME/.config/lxpanel/LXDE/panels/panel.
Editing the file with vim ~/.config/lxpanel/LXDE/panels/panel, I can see where the launchbar plugin and config is added. If the plugin is not already added to the panel, you will need to add this for each user. Notice that launchbar plugins will appear in the panel in the same order that they appear in this file.
Additionally, you will need to add the Button config with an id path to the .desktop file for each application that you wish to appear within the launchbar. Here is an example of what it looks like.
Plugin {
type = launchbar
Config {
Button {
id=pcmanfm.desktop
}
Button {
id=/var/lib/menu-xdg/applications/menu-xdg/X-Debian-Applications-Network-File-Transfer-transmission_bittorrent_client_(gtk).desktop
}
Button {
id=/usr/share/applications/gimp.desktop
}
Button {
id=/var/lib/menu-xdg/applications/menu-xdg/X-Debian-Applications-Terminal-Emulators-gnome_terminal.desktop
}
Button {
id=/usr/share/applications/gedit.desktop
}
Button {
id=/usr/share/applications/gcalctool.desktop
}
Button {
id=/usr/share/applications/keepassx.desktop
}
}
}
Refreshing the Panel
The wiki even provides a handy script to restart lxpanel to ensure that it will update your changes.
#!/bin/bash
# lxpanel processes must be killed before it can reload an lxpanel profile.
killall lxpanel
# Finds and deletes cached menu items to ensure updates will appear.
find ~/.cache/menus -name '*' -type f -print0 | xargs -0 rm
# Starts lxpanel with the `--profile` option and runs as a background process.
# In this example the profile is LXDE. Profiles are the directories located
# in $HOME/.config/lxpanel/. In this case, $HOME/.config/lxpanel/LXDE.
lxpanel -p LXDE &
If you are running the lxpanel command in your terminal, I recommend using nohup so it won't kill the lxpanel process when the terminal is closed.
nohup lxpanel -p LXDE &