[solved] Trying to run two commands in .desktop menu file

If none of the more specific forums is the right place to ask

[solved] Trying to run two commands in .desktop menu file

Postby bedtime » 2017-07-28 15:20

I have alacarte installed, and it seems to be able to run one command just fine, but I would like it to run two commands: one command, and then another once it has finished.

Here is the command I want to run:
Code: Select all
/bin/rm -rf /home/user/sandbox/epiphany/.[bcXl]*; /usr/bin/firejail --private=/home/user/sandbox/epiphany --dns=8.8.8.8 --dns=8.8.4.4 /usr/bin/epiphany -i


It deletes the contents of a ramfs directory each time it starts up, and then it opens epiphany up in a container. This works when executed from the terminal; I have confirmed that it deletes the contents as well, but it will not run when inserted in menu via alacarte or when I edit a .desktop file. Both commands do not run. I cannot see the output so I don't know what's going on.

Any ideas?
Last edited by bedtime on 2017-07-28 18:36, edited 1 time in total.
bedtime
 
Posts: 6
Joined: 2012-12-16 19:34

Re: Trying to run two commands in .desktop menu file

Postby wizard10000 » 2017-07-28 16:18

This should work in a .desktop file -

Code: Select all
bash -c "/bin/rm -rf /home/user/sandbox/epiphany/.[bcXl]*; /usr/bin/firejail --private=/home/user/sandbox/epiphany --dns=8.8.8.8 --dns=8.8.4.4 /usr/bin/epiphany -i"


Hope this helps -
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1143
Joined: 2011-05-09 20:02
Location: midwestern us

Re: Trying to run two commands in .desktop menu file

Postby bedtime » 2017-07-28 18:35

wizard10000 wrote:This should work in a .desktop file -

Code: Select all
bash -c "/bin/rm -rf /home/user/sandbox/epiphany/.[bcXl]*; /usr/bin/firejail --private=/home/user/sandbox/epiphany --dns=8.8.8.8 --dns=8.8.4.4 /usr/bin/epiphany -i"


Hope this helps -

Works like a charm! :D

I have used the command 'bash -c' in the past, but for some reason hadn't thought to use it in this case. Makes sense why it works!

SOLVED! :D
bedtime
 
Posts: 6
Joined: 2012-12-16 19:34


Return to General Questions

Who is online

Users browsing this forum: berzo84 and 7 guests

fashionable