How to delay executing startup apps? (solved)
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?
Discussion, talk and tips
https://forum.puppylinux.com/
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?
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.
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?
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
mikolaj_q wrote: ↑Fri Jun 24, 2022 8:24 amI 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 Fossapup64Solution by Feek works perfect. Thank You a lot Feek. You've made my life happier and easier
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