I can not run the executable GUI program, offers to choose another to open this file. At the same time, it quietly runs from the console (./ Program).
I want to run an executable program (not a shortcut) from Dolphin.
Is it possible, without creating one for each executable file, to launch this file directly from the file manager (Dolphin mentioned above).

egor@kubuntu:~/Рабочий стол$ ls -l итого 1024 -rw-r--r-- 1 egor egor 2353 июл 28 12:50 Home.desktop -rwxrwxr-x 1 egor egor 1038816 авг 2 23:34 Program -rw-r--r-- 1 egor egor 2757 июл 28 12:50 trash.desktop 

1 answer 1

The procedure for creating a desktop file is described here: How to run a file from the desktop?


without creating a desktop file for each executable file, run this file directly from the file manager

based on this answer: How to force Dolphin to not execute executable files

and the example with the /usr/bin/gimp-2.8 file:

  1. we need to determine the mime type of the file:

     $ mimetype /usr/bin/gimp-2.8 /usr/bin/gimp-2.8: application/x-sharedlib 
  2. look at the section about application/x-sharedlib in the freedesktop type description:

     $ sed -n '/mime-type.*"application\/x-sharedlib"/,/\/mime-type/p' /usr/share/mime/packages/freedesktop.org.xml 

    we get this description (non-essential lines are omitted):

      <mime-type type="application/x-sharedlib"> <comment>shared library</comment> ... </mime-type> 
  3. so that a file with this mime type is considered executable, you can make it a subclass of application/x-executable by adding a line about the sub-class :

      <mime-type type="application/x-sharedlib"> <sub-class-of type="application/x-executable"/> <comment>shared library</comment> ... </mime-type> 

    before making changes, of course, it makes sense to make a backup copy of the file.

  4. To make changes in the /usr/share/mime/packages/freedesktop.org.xml file into the current mime type database, you can use the update-mime-database script, passing the parameter the path to the directory with files, one of which we changed:

     $ sudo update-mime-database /usr/share/mime 

checked on nautilus -e: works.

  • Thanks, it helped. - Egor Moroz