Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
31
rated 0 times [  31] [ 0]  / answers: 1 / hits: 85704  / 2 Years ago, thu, february 24, 2022, 11:34:05

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?


More From » scripts

 Answers
7

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


[#25243] Saturday, February 26, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erranbe

Total Points: 118
Total Questions: 95
Total Answers: 117

Location: Virgin Islands (U.S.)
Member since Tue, Jul 7, 2020
4 Years ago
erranbe questions
;