How to delay a program such as cairo-dock (No openGL) or Firefox?
Sometimes programs crash when started with other startup apps. I want programs to start 10 seconds late to avoid a crash.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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, KDE, etc.
With this solution there's no need for a script or sleep. Head to your autostart folder:
.desktop file that corresponds with your application and open it in a text editor, e.g.
Append the following line to the file:
foo is the time in seconds you want to delay the application launch by, e.g.:
Save the file, relog and you should see the effects.
bash -c "sleep 10 && firefox"
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'
I had to use this to get it to work for skype:
sh -c "sleep 10 && skype &" in Ubuntu 12.04