Page 1 of 1

How to delay executing startup apps? (solved)

Posted: Wed Apr 06, 2022 6:52 am
by mikolaj_q

I want to add an application to startup apps this way -->> Setup -->> Startup Control but there is no option to delay it. How can I do it the simplest?


Re: How to delay executing startup apps

Posted: Wed Apr 06, 2022 12:19 pm
by Feek

Generally, there is a "startup" folder in /root.
Scripts or symlinks to the executable files, located here (/root/startup), will be activated each time the X is starting.

Theoretically, it should be possible to create a new script in this location that would contain something like this:

  • command sleep number_of_seconds (e.g. sleep 10), and on the next line

  • command to launch your application.

Then save the script and make it executable.

It depends on what specific app you are talking about.


Re: How to delay executing startup apps

Posted: Wed Apr 06, 2022 1:08 pm
by bigpup

What specific version of Puppy Linux???

Are you asking about adding a app using Boot Manager -> Startup?

Give us some specific details on the specific app you are asking about adding to startup directory?
why does it need to be delayed?


Re: How to delay executing startup apps?

Posted: Fri Jun 24, 2022 8:24 am
by mikolaj_q

I want to delay Firefox startup because network connection is not ready when Firefox autostarts and i have to reload all needed tabs when network connection is available. You know i press power on and in one minute my workstation is fully ready for work :)
I use Fossapup64

Solution by Feek works perfect. Thank You a lot Feek. You've made my life happier and easier :thumbup:


Re: How to delay executing startup apps?

Posted: Fri Jun 24, 2022 11:00 am
by fredx181
mikolaj_q wrote: Fri Jun 24, 2022 8:24 am

I want to delay Firefox startup because network connection is not ready when Firefox autostarts and i have to reload all needed tabs when network connection is available. You know i press power on and in one minute my workstation is fully ready for work :)
I use Fossapup64

Solution by Feek works perfect. Thank You a lot Feek. You've made my life happier and easier :thumbup:

The delay (e.g. sleep 10) before executing the command works of course, but here's a way to check connection, wait until there is actually a network connection, then execute the command:
(required is to have "curl" installed)

Code: Select all

# check network, wait until there is connection, will stay in loop until there's connection
 case "$(curl -s --max-time 2 -I https://duckduckgo.com | sed 's/^[^ ]*  *\([0-9]\).*/\1/; 1q')" in
  [23]) : ;;
  *) echo "No network connection yet...";;
 esac

while true
do
 case "$(curl -s --max-time 2 -I https://duckduckgo.com | sed 's/^[^ ]*  *\([0-9]\).*/\1/; 1q')" in
  [23]) break;;
  *) : ;;
 esac
sleep 3
done

# command to execute after there's a network connection, e.g. firefox
firefox