How to make it so bash runs instead of asking where to run upon selection from file navigator

5,367

You can't do it with the bash script directly, you will need to create a .desktop file for it instead. For example, if your bash script is saved as /home/cenoc/bin/script.sh, create a file called script.desktop with the following contents:

[Desktop Entry]
Name=My script
Comment=Describe your script here
Exec=/home/cenoc/bin/script.sh
Terminal=false
Type=Application

Then, double click on script.desktop and your script should be executed.

Share:
5,367

Related videos on Youtube

Randy Rakestraw
Author by

Randy Rakestraw

Updated on September 18, 2022

Comments

  • Randy Rakestraw
    Randy Rakestraw over 1 year

    When I double-click on bash files on Linux Mint a pop-up appears querying whether I want to run in terminal, display, run, or cancel. I was wondering, how do I make it so for this particular bash file it runs without this pop-up (preferably without the presentation of the terminal). Any help would be much appreciated!

  • Randy Rakestraw
    Randy Rakestraw almost 10 years
    I would understand the security fear, but I just want a layman user to be able to come up to this and double click without having something pop-up like this complicating the arrangement. I could always write-up and compile something to do what the bash file is doing, but was hoping I can just use the bash file and change the icon.
  • WeeBo
    WeeBo almost 10 years
    Well it depends on what file manager you're using as well. Some will have different behaviour. Example for caja, native in Mint afaik. Go to Edit>Preferences>Behaviour Under Executable text files you have 3 options. Select which one you need. The first option should work for your case. Should also work in nemo as well.