Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

7 Answers 7

  1. Open Nautilus.

  2. Open this from the menu bar:

    Edit → Preferences

  3. Select the 'Behavior' tab.

  4. Select "Ask each time" under "Executable Text Files".

  5. Close the window.

Now you can double-click your executable text file in Nautilus to be asked whether to execute or edit your script.

enter image description here


Answer credit: Nur

share|improve this answer
3  
Thank you very much –  Rob Apr 27 '13 at 15:39

Follow these steps:

Install dconf-editor because it isn't installed by default.

Hit Alt+F2, type dconf-editor and hit Enter.

In dconfg-editor goto: orggnomenautiluspreferences

enter image description here

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. Thats it!

share|improve this answer
5  
You can also open nautilus, click Files > Preferences, check behaviour tab, and select the option you prefer for Executable Text Files, open with text editor is the default. –  Nur Apr 27 '13 at 14:03
    
Thanks for your help –  Rob Apr 27 '13 at 15:39
    
Next solution is easiest way of doing :) –  mac May 9 '13 at 6:24
    
Although this works too, dconfg-editor is the worst possible way of changing application configuration. –  Benjamin May 5 at 18:15

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;

  1. install (if you haven't already) and start dconf Editor,
  2. go to: org > gnome > nautilus > preferences, and
  3. change the value for executable-text-activation back to ask (or even launch, if you prefer).

If you want the same Nautilus behavior as Root as well you can repeat the steps above, starting dconf Editor this time as Root.

share|improve this answer
1  
Thank you very much! –  Olivier Van Bulck Apr 2 '13 at 17:26

Change Nautilus' Behavior with Executable Text Files

Open Nautilus

enter image description here

  1. Files > Preferences
  2. Go to Behaviour tab
  3. Select Ask Each Time

Double-click your Executable Text File in Nautilus

Voila!


Answer credit: Nur, Jorge Castro

share|improve this answer

in a terminal

gsettings set org.gnome.nautilus.preferences executable-text-activation ask
share|improve this answer

For that I guess the best way will be to make .desktop launcher, make that launcher executable using

chmod +x blah.desktop

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

[Desktop Entry]
Type=Application
Terminal=false
Icon=/path/to/icon/icon.svg
Name=give-name-here
Exec=/path/to/file/executable
Name=unmount-mount
share|improve this answer

GUI

  1. Depending on which Ubuntu version you have,

    • Before 13.04

      In Nautilus, open this from the menu bar:

      Edit → Preferences

    • 13.04 or 13.10

      In Nautilus, open this from the menu bar:

      Files → Preferences

    • 14.04

      In Nautilus, open this from the menu bar:

      Edit → Preferences

  2. Then, in the 'Behaviour' tab, select "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.

    enter image description here


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)

Originally from another answer posted by me here.

share|improve this answer
1  
@DKBose: The command 'dconf' is in Ubuntu by default. dconf-editor only provides the GUI program to edit dconf. –  minerz029 Feb 23 at 8:43
    
You are correct. Sorry about that! –  DK Bose Feb 23 at 11:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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