0

The following command from terminal works perfectly:

sh /home/flux/Downloads/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh

How would I go about adding this as a shortcut, so I can open teamspeak from my Unity Launcher panel on the left without using the terminal?

7
  • 1
    @muru definitely a look-alike, only nothing about bash or shell there... Sep 24, 2014 at 7:56
  • @JacobVlijm then we'd have to have question for every interpreter out there: the shells, the pythons, the perls, the phps, the bfs, the gnuplots, ....
    – muru
    Sep 24, 2014 at 8:01
  • @muru I partially agree, but believe mainly the last section (bash -c) is somewhat outside the scope of the other question. Sep 24, 2014 at 8:10
  • 1
    @muru strictly yes, but running bash commands from the launcher is a subsection of the subject that could use some attention on its own; it is a bit more than <application><option> like in firefox. In many cases, subjects on AU are subsections of each other. There is always the decision of where to allow that or not. In this case, I can live with both. Sep 24, 2014 at 8:21
  • 1
    My apologies for the duplicate question. I did attempt to find a similar thread. Though the suggestion from your link regarding "Alacarte" was perfect - this tool helped me create the shortcut a lot easier than the manual method. Thanks!
    – PiedPiper
    Sep 25, 2014 at 9:48

1 Answer 1

2

In its most basic form:

create a .desktop file (paste the text below in an empty file):

[Desktop Entry]
Name=Start Teamspeak
Exec=/bin/bash /home/flux/Downloads/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh
Icon=/path/to/your/icon
Type=Application

save the file as team.desktop in ~/.local/share/applications and drag it from there on to the launcher.

Explanation

Running scripts from a .desktop file

If you run a script in the Exec= line from a launcher like this, it works like in the terminal:

  • If the script is not executable:

    language /path/to/script.language_extension
    
  • If the script is executable, just:

    /path/to/script.sh
    

    If the script is executable, the language extension is not strictly needed. However, if you use it on the file, also use it in the command.

Running more complicated shell commands from a .desktop file

Exec=/bin/bash -c "your_complicated_command_here"
(command inside quotes)
5
  • Is need to use sh here Exec=sh /home/flux/Downloads/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh. sh after Exec=sh<--this Sep 24, 2014 at 7:19
  • @KasiyA I am afraid I don't understand what you mean? Sep 24, 2014 at 7:19
  • 1
    @KasiyA yes, if the script is not executable the sh is needed, otherwise it won't hurt. Sep 24, 2014 at 7:22
  • thank you I didn't know that. We can execute script by itself with adding chmod +x scriptName.sh and remove the sh behind Exec= Sep 24, 2014 at 7:24
  • IMHO Never use sh as the interpreter on scripts unless the script is known to be sh-compatible. Prefer bash, if the user mentions bash.
    – muru
    Sep 24, 2014 at 7:51

Not the answer you're looking for? Browse other questions tagged .