0

I just wanted to create a script that opens Teamspeak. I was on here before about that, but I thought it would be more simple by just creating a script.

I wanted to make a script to launch the script that opens Teamspeak.

So I did this:

#!/bin/bash
exec /home/austin/Programs/Teamspeak/launch(what I renamed the file to for ease).sh

I named this Teamspeak.sh and it didn't work. The thing that is frustrating is that it works if I go into terminal on the Desktop and type

./Teamspeak.sh

it works!

How can I get this to work by just double-clicking it?

ElefantPhace
  • 3,190
  • 3
  • 18
  • 29
Kiwi
  • 1
  • Just curious as to why your creating a script to launch another script. Why not just launch your first 'launch.sh'? – ElefantPhace Jul 31 '14 at 04:15
  • Have a look at http://askubuntu.com/q/281293/158442. You can create a . desktop file with Terminal=true. – muru Jul 31 '14 at 04:26

2 Answers2

0

I'm not sure where you're "double clicking" on it but if it's in Nautilus there is a setting in preferences about how to handle executable files. It's on the "Behavior" tab of the preferences dialog.

Speaking of executable, you did chmod to make your script executable right?

No Time
  • 1,073
  • 11
  • 25
  • 1
    Welcome to AskUbuntu! If you could expand on your answer further (i.e. right click on file, select make executable, etc.) it would really improve your answer screen shots might be helpful as well. For future reference try to not ask a separate question in answers, and instead post additional questions in comments. – No Time Jul 31 '14 at 03:51
0

Easy way, right-click Teamspeak.sh on your desktop. Click Properties. Go to Permissions tab, and tick the Execute option at the bottom. Click OK, and now try double-clicking it.

You may have to use dconf-editor if it doesn't ask you if you want to run, or launch it immediately.

If you don't have dconf-editor you can install it by

sudo apt-get install dconf-tools

Then type dconf-editor into your terminal to open it.

Navigate to org ➤ gnome ➤ nautilus ➤ preferences
and look for executable-text-activation

Click the option next to it and choose whether you want to launch or ask

Close dconf-editor and now double-click it.

If you chose launch it'll run your script the same as if it were a program.
If you chose ask it'll prompt you with the options to Run in Terminal, Display, Cancel, or Run

ElefantPhace
  • 3,190
  • 3
  • 18
  • 29