3

I'd like to know what is exactly happening when I double-click on an icon of a desktop file, which contains the line like this:

Exec=/bin/sh /absolute-path/script

There is probably an Ubuntu application, which takes care of that, right?

(I'm on Xubuntu with kernel 3.2.60)

  • That line is exactly what happens. It says, execute - with the /bin/sh interpretor - the program or script found at /absolute-path/script. You can even try it manually in a terminal, or through the handy alt-F2 dialog, by running /absolute-path/script. – amanthethy Dec 19 '14 at 20:59
2

As usual ps axjf shows the tree of running processes. E.g. I am using gnome "fallback" session and clicked MC icon. the tree is: init - lightdm - lightdm - init - gnome-session - gnome-panel - gnome-terminal - mc.

Starting it from menu gives gnome-panel to be a parent process that has started your launcher.

1

The desktop file is based on a freedesktop.org standard which environments like Unity, Gnome, Xfce, and KDE follow. The desktop environment will interpret the file and run the program based on the file's contents.

  • This page describes the desktop file format (which is good), but says almost nothing about how it is interpreted – HEKTO Dec 19 '14 at 23:50
0

Check out this guide on launchers and desktop files.

Unity Launchers are actually files stored in your computer, with a '.desktop' extension. In earlier Ubuntu versions, these files were simply used so as to launch a specific application, but in Unity they are also used so as to create right-click menus for each application, which you can access from the Unity Launcher.

The lines in the file are basically instructions for your desktop environment on what to do with the application/launcher when clicked on or launched from that .desktop file. For example, the "Exec=..." line is an instruction to execute the command that follows the "=" char.

You should be able to open the files with vim, nano, gedit, or just about any text editing program.

  • I don't think I'm on Unity. Also I well understand that I can open these files with text editor. I need more deep understanding of the step-by-step process of application launching – HEKTO Dec 19 '14 at 20:58
0

That line is exactly what happens.

It says, execute - with the /bin/sh interpretor - the program or script found at /absolute-path/script.

You can even try it manually in a terminal, or through the handy alt-F2 dialog, by running /absolute-path/script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.