How do I add a system-wide menu item to the Applications menu?
You can create the proper .desktop
file and place it in /usr/share/applications
which is the global place for applications.
It would like something like this:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Sample Application Name
Comment=A sample application
Exec=/opt/application
Icon=application.png
Terminal=false
Categories=Application
Name
will set the name that appears in the menu, and Category
will place it in a certain category in the menu. Exec
is the command to start the program, it uses full paths and can also take parameters. You can open the other .desktop files in /usr/share/applications
with a text editor to get an idea.
For more info: desktop-files
To add an entry of a program installed manually system wide you need to create a .desktop file in /usr/share/applications
.
Desktop files have the following syntax:
[Desktop Entry]
Version=0.0 # Program version if applicable
Encoding=UTF-8
Name=nameof-application # as it appears in the desktop entry
GenericName=generic-name # as it is named for real
Comment=What the application does # textual explanation
Exec=/opt/programfolder/program # path to the program
Icon=/opt/programfolder/icon # path to the custom icon
Terminal=false
Type=Application
StartupNotify=false
Categories=AudioVideo;Audio; Network; # Category for Menu-Entry
MimeType=video;audio;
Edit the file to your needs and save it as root as nameof-application.desktop
. Full specification of desktop entries can be found at Freedesktop.org