before in Ubuntu 12.04 when I make simple bash commands, it works but in Ubuntu 13.10 I can only open it with gedit! How I can run it by only one click?
-
1Use. Desktop. Files. – Aurelia Nov 20 '13 at 12:06
-
It did not work – Deniz Nov 20 '13 at 13:02
-
see e.g. http://askubuntu.com/questions/378071/stop-py-opening-in-gedit – Takkat Nov 20 '13 at 13:10
2 Answers
Open the file manager, go to the Files
menu and select Preferences
to open the "Preferences" dialog.
In the Behaviour
tab activate the option Run executable text files when they are opened
in the Exexcutable Text Files
section:
Note that this may cause you to run potential harmful code instead of opening it in a text editor. So it's usually better to activate Ask each time
instead.

- 87,389
Open your editor , for example gedit and paste this lines.
[Desktop Entry]
Version=x.y
Name=ProgramName
Comment=This is my comment
Exec=/home/alex/Documents/exec.sh
Icon=/home/alex/Pictures/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;
save this file with somename.desktop
Description of those lines :
Version is the version of this .desktop file.
Name is the name of the application, like 'VLC media player'.
Comment is a phrase or two describing what this program does, like 'Plays your music and videos files'.
Exec is the path to the executable file. The full path to the executable file must be used only in case it isn't in any of the paths specified in the $PATH variable. For example, any files that are inside the path /usr/bin don't need to have their full path specified in the Exec field, but only their filename. To see all the paths in the $PATH variable you can open a terminal using Ctrl+Alt+T and type in
echo $PATH
Icon field is the icon that should be used by the launcher and represents the application. All icons that are under the directory /usr/share/pixmaps don't need to have their full path specified, but their filename without the extension. For example, if the icon file is /usr/share/pixmaps/wallch.png, then the Icon field should be just 'wallch'. All other icons should have their full path specified.
Terminal field specifies whether the application should run in a terminal window or not.
Type field specifies the type of the launcher file. The type can be Application, Link or Directory, but this article covers the 'Application' type.
Categories field specifies the category of the application. It is used by the Dash so as to categorize the applications. A launcher being a 'Utility;Application;' should be under the 'Accessories' section etc.

- 102,391
- 106
- 255
- 328