Skip to Knowledge Base content

Create an Application Menu Item For The GNOME Menu System in RedHat 7.x

Tags linux readhat

Some applications aren’t fully GUI compliant – they are intended to be launched from the command line. Some of these applications, such as Matlab, have their own windows and are independent of the terminal after launch. Some are intended to run within a terminal window. This article is intended to address the former and not the latter.

 

1. As Root or someone with Root privileges, create the file: 

/usr/share/applications/<NameOfMyApplication>.desktop

You can use the touch command to do this. For example:  /usr/share/applications/Matlab.desktop

To verify, type:  ls /usr/share/applications/ and check that the name of your application shows up in the list.

Note that this creates a menu item that is available to all users. To create a user specific menu item, create the xx.desktop file in:  ~/.local/share/applications/

In this case, elevated privileges are not needed.

Using a text editor such as VIM or Nano, add the following content to the file:

[Desktop Entry]

Type=Application

Name=My Application 1

Icon=myapplication1

Exec=myapplication1

Categories=Network;WebBrowser;

MimeType=application/x-newtype

Where:

Name is the name of the application as you want it to appear in the menu.

Icon is the name of the application.

Exec is the path to the application’s executable file

Categories is the Application sub menu (or menus) where you want the icon to appear. Click on the Applications menu to see a list of existing options.

MimeType associates the application with the application/x-newtype MIME type. This shouldn’t be changed.

2. Logout and back in

Verify that the link exists as expected and launches the desired application.

Was this helpful?
0 reviews

Details

Article ID: 10274
Created
Fri 12/11/15 1:13 PM