Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to delay a program such as cairo-dock (No openGL) or firefox

Sometimes it crashes when started with other startup apps.

I want it to start 10 seconds late so it will not crash.

Thank you, (I'm just using Ubuntu for a month, so please advice!)

share|improve this question
    
see askubuntu.com/questions/22512/… –  belacq Mar 2 '11 at 7:54

4 Answers 4

Delaying autostart with inbuilt delay option


Note: Only works with desktop sessions that recognize the X-GNOME-Autostart-Delayparameter (e.g. Unity, Unity2D, GNOME). This will not work for LXDE, XFCE, Kubuntu, etc.


With this solution there's no need for a script or sleep. Head to your autostart folder:

nautilus ~/.config/autostart

Find the .desktop file that corresponds with your application and open it in a text editor, e.g. gedit:

gedit ~/.config/autostart/application.desktop

Append the following line to the file:

X-GNOME-Autostart-Delay=foo

where foo is the time in seconds you want to delay the application launch by, e.g.:

X-GNOME-Autostart-Delay=60

Save the file, relog and you should see the effects.

share|improve this answer
    
This works very well in both ubuntu 12.04 and in 12.10-development release using Gnome-shell 3.6 –  bmbaker Oct 7 '12 at 18:01
    
Perfect. Solved an issue I had with system errors while autostarting a VirtualBox machine. –  solsson Nov 10 '12 at 8:24

Try this: bash -c "sleep 10 && firefox"

share|improve this answer

You could try to change the command to this:

sleep 10 && firefox

Some people say it works, some say it doesn't, if this is your case, and it does not work, you can try with:

xterm -e 'sleep 10 && firefox'
share|improve this answer

I had to use this to get it to work for skype: sh -c "sleep 10 && skype &" in Ubuntu 12.04

share|improve this answer

Your Answer

 
discard

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