2

I wanted to run a bash script with double click and I eventually found shc to do so but, despite it doing what I wanted, it needs specific permissions if transfered to another computer or if it's downloaded from a site.

Thus, my question asking for a type of file or command that's able to turn and .sh file (or any other type of file for that matter, I'm willing to re-write if necessary) without it needing to be marked as executable from the terminal with something like chmod +x <filename>.

All help on the matter appriciated, even if the solution means needing to begin from zero again.

ulovah
  • 119

1 Answers1

0

A definite solution depends on where you want to give the double click; on the desktop or in File Manager. Consider the following scenario, trusting you are familiar with notify-send.

Open a terminal and enter:

$ echo "notify-send 'hello world!'" > Notify

Check the file does not have x-bits:

$ ls -l Notify
-rw-rw-r-- 1 willem willem 32 apr 22 15:06 Notify

Test that it works:

$ bash Notify

Close the terminal, then start File Manager. Right click on Notify and select Open With -> Open With Other Application. Click on Use a custom command and type in bash, click on Open. You should see the "Hello world!" response.

Next double click Notify and voila!
To finish, right click on Notify -> Send to -> Desktop (Create Link). An icon appears on the desktop. Double click it...

Done !

αғsнιη
  • 36,350