When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?
When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?
Open Nautilus.
Open this from the menu bar:
Select the 'Behavior' tab.
Select "Ask each time" under "Executable Text Files".
Select the "Permissions" tab, and make sure "Allow executing file as program" is selected.
Close the window.
Now you can double-click your executable text file in Nautilus to be asked whether to execute or edit your script.
Answer credit: Nur
Follow these steps:
dconf-editor
because it isn't installed by default.dconf-editor
and hit Enter.In
dconfg-editor
goto:org
➤gnome
➤nautilus
➤preferences
Click on
executable-text-activation
and from drop down menu select:launch: to launch scripts as programs.
OR
ask: to ask what to do via a dialog.
Close
dconf-editor
. That's it!I think this is a nuisance caused by Gnome people who decided to change that default behavior we were accustomed to.
To fix it, you can;
If you want the same Nautilus behavior as Root as well you can repeat the steps above, starting dconf Editor this time as Root.
in a terminal
Using GUI
Depending on which Ubuntu version you have,
14.04 or 16.04
In Nautilus, open this from the menu bar:
18.04+
In Nautilus, open this from the menu bar:
Then, in the 'Behavior' tab, select "Run them" (previously "Run executable text files with they are opened").
Alternatively, select "Ask each time" instead if you would like a dialog (example) asking you whether to edit or execute the file.
Using Command line
If you prefer a command:
Note: Both GUI and command line methods work only for Nautilus (the default graphical file manager in Ubuntu).
Originally from another answer posted by me here.
For that I guess the best way will be to make .desktop launcher, make that launcher executable using
And after that you will be ready to run it via just clicking, and even more you can add it to launcher. To read more about how to make .desktop files look here. Main part of it is this
You can do this for a single file by going into permissions in file properties and selecting "run this file as an executable".
You can use the most upvoted answer in Fedora 20 + GNOME too:
You have to check 3 points :
right click on the file -> open with -> other application -> view all applications -> run software -> select
from now on shell scripts will be run on double click.