How to start two Ubuntu applications in one go?
Lets suppose that there are two binary files, e.g. XXX
and YYY
, at destination /usr/bin/
. I want to start them at once, always! In other words, when I type the name of either of those in unity, I want to make both of them start. How could I change the corresponding files at destination /home/username/.local/applications/
to do so? I tried this /usr/bin/XXX;/usr/bin/YYY;
on terminal but it doesn't seem to work.
As I understand you need to edit your .desktop
file. Add this line next to Exec
:
sh -c "/usr/bin/XXX & /usr/bin/YYY"
The -c
flag tells to the shell that it has to read the commands from string, instead of from the standard input.
If you use only /usr/bin/XXX & /usr/bin/YYY
it won't work. Just to add the reason why &
doesn't work in a launcher, it's because &
is a feature of the shell, and the launcher isn't a shell, its a much simpler environment for running commands.
/usr/bin/app_first &
/usr/bin/app_second
Using '&' you are sending process into background.
You should use
/usr/bin/XXX && /usr/bin/YYY;
Note the use of &&
(no need to use &
to run something in the background).