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.
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.
Make a startup command using https://askubuntu.com/a/48327/139749 . Then you can add delay by opening
~/.config/autostart and edit related file. You should add the following commands:
Solution by @Noraj works well for Ubuntu 18.04. Adding a couple of practical examples for Google Drive sync via Insync, and Synology cloud-drive. I don't want them to delay the startup.
And for cloud-drive:
Name=Synology Drive Client
Comment=Synology Drive Client
Both files locate at
$HOME/.config/autostart if you installed the applications and chose to make them start at login.