This is related to questions like “How do I run executable scripts in Nautilus?” or “How to execute a script just by double clicking like .EXE files in Windows?”.
I would also like to have shell scripts run if they are opened in the file manager (Nautilus), but the usual setting (org ➤ gnome ➤ nautilus ➤ preferences ➤ executable-text-activation
) is not fine-grained enough for my purposes. If I set it to ask
or launch
, any text file with the executable bit set will (ask to) be launched as a script. This is problematic because we have some scripts on a file system (CIFS) which does not support Unix permissions (owner/group, rwx). That means that when I mount this file system, I can only either
- set all files as executable (including, of course, any text files) or
- set all files as not executable.
Consequently, when I open any text file (*.txt
/MIME type text/plain
), even if it has no script-related contents, the file will still (ask to) be executed. This is really annoying and irritating for inexperienced users – of course I don’t want to “run” a text/plain
file.
Is there a way to make Nautilus treat only actual shell scripts (e. g. MIME type application/x-shellscript
) as executable scripts?
0 Answers