Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 run a script automatically when an application start. How would I do this without making the script run at start-up?

My current approach is writing a script with an infinite loop and made it run at start-up. Then let it check if a certain app is running.

share|improve this question
Why exactly do you need this? Isn't it an option to simply use a wrapper script or something like that? – JanC Oct 26 '10 at 9:03
up vote 4 down vote accepted
  1. If the way of starting the application is always manual then create another script with the links to the script you mentioned plus the application. Then link this new script to the launcher.
  2. If the application is launched by another application then you have to rename the original application and then put the script mentioned in my above point 1 in place of the original application and rename it with the same name as that application.
share|improve this answer
thanks for the tip jumbli, it worked. i used Gnome-Do for the launcher. – James Oct 26 '10 at 10:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.