Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to autostart a program with multiple commands within one.

Here are my 3 separate commands:

sleep 3s
cd /home/user/programdir/lpfw/
gksudo ./lpfwpygui

My command is sleep 3s;cd /home/user/programdir/lpfw/;gksudo ./lpfwpygui.

It works fine if run manually from terminal, but I can't get it to work from autostart entry.

Any ideas?

share|improve this question
up vote 1 down vote accepted

Try making a script with your commands and running the script from the autostart entry:


sleep 3s
cd /home/user/programdir/lpfw
gksudo ./lpfwpygui

You should also try sleeping for longer, 3s may not be enough for the Desktop Environment to finish loading and that could cause problems since you are using gksudo.

share|improve this answer
thanks for replying; one thing is the program doesn't run if gksudo /home/user/programdir/lpfw/lpfwpygui but will run after cd to parent dir and then gksudo ./ that's weird – Yopbot Dec 2 '12 at 17:11
@user177480, OK, changed the script. So, does it work if your autostart entry calls the script? Does it work if you increase the sleep time? – terdon Dec 2 '12 at 17:22
yes all good thanks a lot; do you have any idea why it doesn't work if i type "gksudo /path/script" while it works if i cd first and then gksudo? – Yopbot Dec 2 '12 at 17:28
@user177480, not really no. Some kind of security feature probably but I don't know. Also, while thanks are always appreciated, the standard way of thanking people on the stackexchange network is to upvote and/or accept their answer (the check mark to the left of an answer). – terdon Dec 2 '12 at 17:30
done ! but i can't upvote as it requires 15 reputation i have only 8 :(, wish i could, sorry – Yopbot Dec 2 '12 at 17:33

You must log in to answer this question.

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