Time Delay Startup Application

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
raulthree
Level 1
Level 1
Posts: 4
Joined: Sat Apr 16, 2011 12:43 pm

Time Delay Startup Application

Post by raulthree » Sat Apr 16, 2011 1:21 pm

Is there a way to add a time delay to an application put in this list?

I have a web based app that I put in there but get page cannot be displayed because Firefox starts faster then the network connection. I figured a time delay would be the best way to solve it. but other solutions would be appreciated as well.

Thanks

oc999
Level 1
Level 1
Posts: 27
Joined: Sat Feb 13, 2010 6:52 am

Re: Time Delay Startup Application

Post by oc999 » Sat Apr 16, 2011 1:48 pm

not sure if this works but try
sleep x && name_of_application
example:
sleep 20 && vlc
this will wait 20 seconds and then start vlc as far as i know!

raulthree
Level 1
Level 1
Posts: 4
Joined: Sat Apr 16, 2011 12:43 pm

Re: Time Delay Startup Application

Post by raulthree » Sat Apr 16, 2011 2:15 pm

No luck with

sleep 15 && firefox %u

the browser window failed to come up at all.

oc999
Level 1
Level 1
Posts: 27
Joined: Sat Feb 13, 2010 6:52 am

Re: Time Delay Startup Application

Post by oc999 » Sat Apr 16, 2011 2:32 pm

hmhm strange. it does work if I type it in a terminal and also with alt+F2.
where did you add the startup application ? did you use the mint GUI or did you edit some file ?

raulthree
Level 1
Level 1
Posts: 4
Joined: Sat Apr 16, 2011 12:43 pm

Re: Time Delay Startup Application

Post by raulthree » Sat Apr 16, 2011 3:35 pm

I'm using the mint GUI

raulthree
Level 1
Level 1
Posts: 4
Joined: Sat Apr 16, 2011 12:43 pm

Re: Time Delay Startup Application

Post by raulthree » Sun May 22, 2011 2:28 pm

I tried to do this in the Alt+F2 window as well it does nothing there also

Inkit
Level 5
Level 5
Posts: 678
Joined: Fri Jun 25, 2010 4:44 am

Re: Time Delay Startup Application

Post by Inkit » Sun May 22, 2011 9:09 pm

Hi raulthree,
Have you tried with the full launch command. For example if I try to start firefox by just typing firefox in terminal it doesn't start. I have to go to menu>internet right click on firefox and check properties. In there you'll find the command to start firefox. Maybe using that with the command that oc999 gave will work. For example I'm using LMDE and the command for me is

Code: Select all

/opt/firefox/firefox %u

User avatar
Carl
Level 5
Level 5
Posts: 695
Joined: Wed Apr 15, 2009 5:20 pm
Location: Isle of Wight, UK

Re: Time Delay Startup Application

Post by Carl » Sun May 22, 2011 9:18 pm

to delay start-up applications I use a small bash script and save it in my directory

Code: Select all

#!/bin/bash
sleep 20 && *program here* &

Habitual
Level 13
Level 13
Posts: 4870
Joined: Sun Nov 21, 2010 8:31 pm
Location: 0.0.0.0

Re: Time Delay Startup Application

Post by Habitual » Sun May 22, 2011 10:23 pm

Code: Select all

#!/bin/bash
sleep 3 
firefox "http://forums.linuxmint.com/viewtopic.php?f=90&t=70708&sid=5ccfff1106025916e8eabb0742f58a41"
exit
pulls up this topic.

fatmick
Level 1
Level 1
Posts: 4
Joined: Mon Apr 12, 2010 10:22 am

Re: Time Delay Startup Application

Post by fatmick » Fri Mar 16, 2012 1:30 pm

None of this worked for me (Mint 12). But I found this did work:

In the GUI, enter the following in the 'command' field:

bash -c "sleep x; program" where x is the delay in seconds and program is the command to run the program.

For example, I wanted to delay Skype startup, as there is an issue with it not appearing in the notification area when it starts up automatically in Mint 12, so I edited the Skype autostart entry command to:

bash -c "sleep 10; skype"

Works a treat!

User avatar
DrHu
Level 17
Level 17
Posts: 7537
Joined: Wed Jun 17, 2009 8:20 pm

Re: Time Delay Startup Application

Post by DrHu » Fri Mar 16, 2012 2:12 pm

I think the best way/method is not to delay a program because of some other event, but to test that the other event is clear before running the program
  • So, yes you could create a delay for the browser, but you could also check the network is active, for example include a ping test to the web site, showing that it is connected and up
    --then run you webb application within firefox..
http://ss64.com/nt/ping.html

travlemon
Level 2
Level 2
Posts: 54
Joined: Fri Mar 05, 2010 2:18 pm

Re: Time Delay Startup Application

Post by travlemon » Sun Jun 11, 2017 2:40 pm

fatmick wrote:None of this worked for me (Mint 12). But I found this did work:

In the GUI, enter the following in the 'command' field:

bash -c "sleep x; program" where x is the delay in seconds and program is the command to run the program.

For example, I wanted to delay Skype startup, as there is an issue with it not appearing in the notification area when it starts up automatically in Mint 12, so I edited the Skype autostart entry command to:

bash -c "sleep 10; skype"

Works a treat!
I know this thread is quite old, but I was looking around for this exact solution. Just wanted to say two things on this topic:

1. The bash -c "sleep x; command" command worked for me as well!
2. In Linux Mint Cinnamon (I have Mint 18 Cinnamon 64-bit), it appears to be built in. You can look for an app in the system menu called "Startup Applications", and when you add a new startup application, there's a "Delay" option where you can set a timed delay. This works perfectly too!

Thanks
For my video tutorials, check out:
http://www.youtube.com/webhunterification

User avatar
JerryF
Level 11
Level 11
Posts: 3832
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: Time Delay Startup Application

Post by JerryF » Sun Jun 11, 2017 3:25 pm

Is this what you're looking for:
Capture_026.jpg
Capture_027.jpg
IF your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line. It helps other members when browsing posts.

Post Reply

Return to “Newbie Questions”