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.

I have tried right clicking on the file selecting properties and then the permissions tab and setting it to execute. However, when I double click the file it opens in gedit. What do I do?

share|improve this question
2  
Duplicate How do I run executable scripts in Nautilus? –  bain May 14 at 0:52
    
Is this for sure about Nautilus? Could be XFCE / Thunar too. Or the file could be mounted with noexec? Or does Nautilus even respect noexec mounts? –  Xen2050 May 14 at 2:03
    
@bain I looked at that before I posted this question. I tried that solution before and it didn't work. –  LarryK May 14 at 2:34

1 Answer 1

up vote 4 down vote accepted

To run your script by double clicking on its icon, you will need to create a .desktop file for it:

[Desktop Entry]
Name=My script
Comment=Test hello world script
Exec=/home/user/yourscript.sh
Icon=/home/user/youricon.gif
Terminal=false
Type=Application

Save the above as a file on your Desktop with a .desktop extension. Change /home/user/yourscript.sh and /home/user/youricon.gif to the paths of your script and whichever icon you want it ot have respectively and then you'll be able to launch by double clicking it.


Specifically, for your situation, you need to do:

  1. Create a script that runs mono LOIC.exe. To do so, create a new text file with these contents:

    #!/bin/bash
    mono /home/logan/.loic/LOIC.exe
    

    Save this as /home/locan/run_loic.sh and then run this command to make it executable (or right click => properties and choose "Allow executing file as program"):

    chmod +x /home/logan/.loic/LOIC.exe
    
  2. Create a .desktop file that launches that script. Create a new text file on your Desktop called run_loic.desktop with these contents:

    [Desktop Entry]
    Name=Run LOIC
    Comment=Run LOIC
    Exec=/home/logan/run_loic.sh
    Icon=
    Terminal=false
    Type=Application
    
share|improve this answer

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.