How to run a script directly when double clicked? [duplicate]
To execute a script, I have to:
- Write the script
- Make it executable
-
Double click it, which shows this window:
- Click the "Run" button.
How can I execute the script directly, without showing the dialog?
GUI
Depending on which Ubuntu version you have,
-
Before 13.04
In Nautilus, go to this menu:
Edit → Preferences
-
13.04 and later
In Nautilus, go to this menu:
Files → Preferences
Then,
in the 'Behaviour' tab, enable "Run executable text files with they are opened"
Command line
If you prefer a command:
dconf write /org/gnome/nautilus/preferences/executable-text-activation "'launch'"
Note: Both GUI and command line methods work only for Nautilus (the default graphical file manager in Ubuntu)