Find The Command Behind The Menu Entry

By | 2008/07/11

Have you ever wondered what the actual command is behind the application you’re launching from the Applications Menu?  I’ve found it useful a number of times, and I have two three methods of finding out what the command actually is.  If there are any Gnome devs reading this, could finding the properties be made simpler directly from the menu itself?

What’s The Command?

There are actually two three ways that I can think of to do this.  One includes the Main Menu Editor, which I blogged about yesterday, the second involves a bit of a quick workaround and the third just uses your browser.  Do you have any other suggestions on how this might be done?

To find the command using the Main Menu Editor you would simply launch the tool:

System > Preferences > Main Menu

Find the application in the list, and then double-click the entry to find the details.  You’ll see something like:

launcher properties as found via the main menu editor

The second method that you can use, and this is the one that I’ve used most often, is quickly adding the application to your panel and then checking the launcher properties.  Because the properties are not available from within the menu itself (again, Gnome devs, can this be added?) we can add the application to the panel and then check the properties.  To find the details this way we’d do the following:

add this launcher to panel

Navigate to the application through the main menu.  Right-click on the application and select “Add this launcher to panel”.  This will add the menu-based launcher to your panel.  The next step is to right-click on the new panel launcher and select properties.  You’ll then find what command and details are being used to launch that application.

panel based launcher properties

Once you’ve found what you’re looking for you can safely remove the newly added launcher via right-click > Remove from panel.

The third method, which was found apparently by accident recently, is simply to drag-n-drop the menu entry into a Firefox tab.  It’ll open the .desktop file, which will outline the command and a whole lot more.  Look for the “Exec=” line for the command used.

7 thoughts on “Find The Command Behind The Menu Entry

  1. orlando_ombzzz

    it hurts me to say this, but , may be Gnome and KDE should learn from Microsoft Windows in this kind of things: the ‘way-to-go’ is so clear and so a no-brainer …

    example:

    how do you find the command begind the menu entry in Windows?:

    the common sense way: right click on the menu entry to open the contextual menu, click on “properties” and read the “destiny” field

    simple ah? why on earth KDE or Gnome didnt’ copy this behaviour? because it is patented? because it was “invented” by Microsoft 😉

    Perhaps we should buy a copy of the purple book of “Smalltalk” [0] and learn about object oriented environment, *this* is the way to go

    pardon for my tone, just a constructive critic, keep the good work guys ! 🙂

    [0] http://live.exept.de/doc/online/english/overview/literature.html

  2. Jenn Baker

    If you want the command behind a menu item, you open the menu editor and check it out, duh. Thankfully I only read the first sentence.. since this one is a no-brainer.

    I can’t believe you actually spent time writing this article, you must have been really bored.

  3. michael ramm

    Contary to Jenn, Thank you Christer!

    I think that this is a very good post for your target audience, which as I gather, is newcomers to Ubuntu Linux.

    I, myself was wondering this very thing last week. My method was to add the icon to the Desktop then check the properties for the launcher name.

    You have always provided a great site with worthwhile tutorials. Thank you for your service to the Ubuntu community.

    Michael

  4. bastianazzo

    Because the properties are not available from within the menu itself (again, Gnome devs, can this be added?)

    Pleeeeeeeeease…is there any Ubuntu Brainstorm, or Gnome mailinglist or any other sort of place where a well-known person like you could put this “so simple yet so needed” idea, so that we can enjoy the wonderfulness of the right click?

    I’m not joking, why should we miss such a useful feature? Could you do something to fix this? Is there any trunk where this has been fixed? How can I learn how to fix this by myself!?!?

    Many thanks

  5. alex-mayorga

    As @bastianazzo said above or as I usually say “bug report or it didn’t happen”, please be a good member of the community by filing your bug report and then updating your post so the ones interested can confirm and patch.
    In the mean time, thanks for the tips.

Comments are closed.