How to delay startup of an application? [Solved]

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Crippled

How to delay startup of an application? [Solved]

Post by Crippled »

I have asked this in other forums without any luck. :( The icon in the panel from Astrill VPN shows up very tiny at times right after boot up due to it starting too soon. How do I delay the auto-start of Astrill VPN? :?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to delay startup of an application?

Post by MrEen »

Most likely something similar to how I start Conky with a delay. In Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Here's the Command I have for Conky: sh -c "sleep 20 && conky"
Crippled

Re: How to delay startup of an application?

Post by Crippled »

:? How would I do this? "/usr/local/Astrill/astrill" /autostart
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to delay startup of an application?

Post by MrEen »

I'm not sure. I'd rather not guess at the syntax in this case with the command already needing quotes. I'm sure someone else will be able solve it.
User avatar
secureIT
Level 4
Level 4
Posts: 471
Joined: Wed Dec 05, 2018 1:26 pm

Re: How to delay startup of an application?

Post by secureIT »

Hi Crippled,

first: please let us know :

did you try the last suggestion from your thread in MX-Forum ? ….. as you did not answerded it ?

http://mxlinux.org/forum/viewtopic.php? ... 55&p=48059
.
Crippled

Re: How to delay startup of an application?

Post by Crippled »

secureIT wrote: Wed Jun 19, 2019 2:11 pm Hi Crippled,

first: please let us know :

did you try the last suggestion from your thread in MX-Forum ? ….. as you did not answerded it ?

http://mxlinux.org/forum/viewtopic.php? ... 55&p=48059
That didn't work.
User avatar
secureIT
Level 4
Level 4
Posts: 471
Joined: Wed Dec 05, 2018 1:26 pm

Re: How to delay startup of an application?

Post by secureIT »

Thank you for the response.
So now let us try further solutions.
I think that:
"/usr/local/Astrill/astrill" /autostart
is the command in autostart.
Is that right ?

If, then lets try something :
1. Go to graphical settings menu >session and startup behavior > automatically launched applications ......
and take the hook out of astrill.
2. restart

3. Open up a terminal and copy this to it .... then press return key :

Code: Select all

#!/bin/bash
(sleep 20s && /usr/local/Astrill/astrill) &
.............and tell us. if that works (but be patient for 20 secs) :)
.
Crippled

Re: How to delay startup of an application?

Post by Crippled »

Yes, "/usr/local/Astrill/astrill" /autostart is the command out of Application Autostart. hook? :? What do you mean by "hook?"
User avatar
secureIT
Level 4
Level 4
Posts: 471
Joined: Wed Dec 05, 2018 1:26 pm

Re: How to delay startup of an application?

Post by secureIT »

simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications
.
User avatar
Gruppo Sportivo
Level 4
Level 4
Posts: 276
Joined: Sun May 28, 2017 4:14 am
Location: 🇳🇱

Re: How to delay startup of an application?

Post by Gruppo Sportivo »

Where is the file or package Astrill Client been installed,probably i guess in the directory /opt

Go to graphical settings menu<->preferences <->startup applications,add a starter named AstrillVpn and edit the delay time.

Startup application command may look something like this /opt/astrilvpn/bin/astrill-client --quiet
Crippled

Re: How to delay startup of an application?

Post by Crippled »

secureIT wrote: Wed Jun 19, 2019 3:05 pm simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications
It started but I got this error. I am going to do a re-boot to see how it starts. $ /bin/sh: 1: nscd: not found
An unhandled exception occurred at $000000000042BF25:
EOSError: Failed to execute "/bin/sh", error code: 127
$000000000042BF25
Crippled

Re: How to delay startup of an application?

Post by Crippled »

secureIT wrote: Wed Jun 19, 2019 3:05 pm simply disable it ..........
edit:
hook is set : ..... enabled
click on the hook ..... it disappears and the autostart of this app is disabled .......
You find the "hooks" into the front menu of autostart applications
Your way didn't work.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to delay startup of an application?

Post by MrEen »

Just to be sure, see if this does it: Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Change the command to sleep 20 && /usr/local/Astrill/astrill /autostart
Last edited by MrEen on Wed Jun 19, 2019 3:43 pm, edited 1 time in total.
Crippled

Re: How to delay startup of an application?

Post by Crippled »

Gruppo Sportivo wrote: Wed Jun 19, 2019 3:18 pm Where is the file or package Astrill Client been installed,probably i guess in the directory /opt

Go to graphical settings menu<->preferences <->startup applications,add a starter named AstrillVpn and edit the delay time.

Startup application command may look something like this /opt/astrilvpn/bin/astrill-client --quiet
It's not in opt. In Application Autostart I have for Astrill this command. "/usr/local/Astrill/astrill" /autostart How do I add 20 seconds to it?
User avatar
secureIT
Level 4
Level 4
Posts: 471
Joined: Wed Dec 05, 2018 1:26 pm

Re: How to delay startup of an application?

Post by secureIT »

if the error occurs after restart ...... next try will be :

Code: Select all

#!/bin/bash
sleep 20s && /usr/local/Astrill/astrill
This is only to find out the correct syntax for this app .........

(I start several apps with delay, but syntax will be not the same for all......... may be its a python script at startup-app - then the syntax will be different to "normal" apps)
then it might be :

Code: Select all

#!/bin/bash
(sleep 20s && python -u /usr/local/Astrill/astrill.py) &
.
Crippled

Re: How to delay startup of an application?

Post by Crippled »

MrEen wrote: Wed Jun 19, 2019 3:42 pm Just to be sure, see if this does it: Menu > Settings > Session and Startup > Application Autostart tab, click on the item then click on Edit. Change the command to sleep 20 && /usr/local/Astrill/astrill /autostart
I just tried that and it prevents Astrill from autostarting.
Crippled

Re: How to delay startup of an application?

Post by Crippled »

secureIT wrote: Wed Jun 19, 2019 3:44 pm if the error occurs after restart ...... next try will be :

Code: Select all

#!/bin/bash
sleep 20s && /usr/local/Astrill/astrill
This is only to find out the correct syntax for this app .........

(I start several apps with delay, but syntax will be not the same for all......... may be its a python script at startup-app - then the syntax will be different to "normal" apps)
then it might be :

Code: Select all

#!/bin/bash
(sleep 20s && python -u /usr/local/Astrill/astrill.py) &
No, the error occurs after 20 seconds of entering that command but Astrill starts. When I reboot Astrill doesn't autostart.
If I re-enable autostart and reboot Astrill starts automatically but too soon because the icon shows tiny in the panel. This is what I get on the second command. python: can't open file '/usr/local/Astrill/astrill.py': [Errno 2] No such file or directory
Last edited by Crippled on Wed Jun 19, 2019 3:56 pm, edited 1 time in total.
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to delay startup of an application?

Post by MrEen »

May ask a silly question? Are you certain the tiny icon is due Astill starting too soon?
Crippled

Re: How to delay startup of an application?

Post by Crippled »

MrEen wrote: Wed Jun 19, 2019 3:55 pm May ask a silly question? Are you certain the tiny icon is due Astill starting too soon?
I think so because if I exit Astrill in the panel and re-open Astrill the icon shows up properly in the panel. It's also the first to start in autostart. What say you?
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to delay startup of an application?

Post by MrEen »

Instead of restarting it, try xfce4-panel -r in the terminal to restart the panel and see if that fixes the issue.

EDIT: It's just first because it starts with "A" and the list is mostly alphabetical.
Last edited by MrEen on Wed Jun 19, 2019 4:04 pm, edited 1 time in total.
Locked

Return to “Xfce”