Swift Software Group

Executable shell scripts open in Gedit on Ubuntu

This started happening after an upgrade to Ubuntu 13.04. We have shell scripts here and there saved as .run files, e.g. Build.linux.auto.run, to automate AVBlocks builds on Linux. Normally Nautilus will ask you whether you want to run the script when you double click a .run file, but on Ubuntu 13.04, Nautilus suddenly started opening .run files in Gedit. It turns out there is a setting in Gnome for that. Here is how to fix it:

  1. Run dconf-editor and navigate to org.gnome.nautilus.preferences
  2. Change the value of the executable-text-activation setting from display to ask.

If you do not have dconf-editor you can install these packages:

sudo apt-get install dconf-tools
sudo apt-get install gconf-editor

And just in case, this is how you run it:

dconf-editor