How to delay executing startup apps? (solved)

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
mikolaj_q
Posts: 11
Joined: Wed Apr 06, 2022 6:46 am

How to delay executing startup apps? (solved)

Post 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?

Last edited by bigpup on Fri Jun 24, 2022 11:31 am, edited 1 time in total.
Reason: added solved to subject
Feek
Posts: 397
Joined: Sun Oct 18, 2020 8:48 am
Location: cze
Has thanked: 51 times
Been thanked: 90 times

Re: How to delay executing startup apps

Post 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.

User avatar
bigpup
Moderator
Posts: 6575
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 797 times
Been thanked: 1377 times

Re: How to delay executing startup apps

Post 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?

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

mikolaj_q
Posts: 11
Joined: Wed Apr 06, 2022 6:46 am

Re: How to delay executing startup apps?

Post 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:

User avatar
fredx181
Posts: 2737
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 306 times
Been thanked: 1104 times
Contact:

Re: How to delay executing startup apps?

Post 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
Post Reply

Return to “Users”