1

Recently I switched over to Linux Mint. I am finally getting the hang of using the terminal, but there is one question that I find myself coming back to:

Is it possible to start a program that is stored in the system's menu?

I know that programs like e.g. firefox and libreoffice place an executable file in the /bin/ or /usr/bin/ folders (and that you can use which programname to find out where it is stored) and they seem to be able to be executed from any location the terminal might be at. But is there a way to run programs that are stored in the menu, but not in one of above-mentioned folders?

1
  • 1
    It would be unusual to have a program in the menu that isn't in /usr/bin or /bin. Commented Aug 4, 2015 at 23:31

3 Answers 3

4

In XFCE you can drag the icon of your desired application with your mouse to your terminal, you should see the name of the shortcut. This is what I got for Abiword:

/usr/share/applications/abiword.desktop

Then you can view this file with less /usr/share/applications/abiword.desktop, or just find the executable:

grep Exec /usr/share/applications/abiword.desktop

which reports:

Exec=abiword %U

So whenever you click on abiword, or drag a document file on it, it executes abiword, and then the name of the file. This is also true for "programs that are stored in the menu, but not in one of above-mentioned folders" (PATH).

You can also add appropriate folders to your path. Just add this in ~/.bashrc (if you use bash which is most likely):

export PATH=$PATH:/path/to/binfolder

Obviously you should replace /path/to/binfolder with the folder which your desired application resides.

2

Short answer yes.

But if the executable isn't in one of the directories in your $PATH, then you would have to call the executable with the full /path/to/executable.

2

Menu entries or desktop shortcuts are .desktop files. The standard location for the desktop files of applications installed system-wide is $XDG_DATA_DIRS/applications (by default it is set to /usr/local/share/applications and /usr/share/applications) and for the things installed in your home or menu items you created it is $XDG_DATA_HOME/applications ($HOME/.local/share/applications by default).

Once you have its path, to "run" the desktop file you can use :

xdg-open path/to/application.desktop

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.