starting an app, after ALL other desktop initialization

Hi folks,

I am installing Manjaro for Arm 64 bit on a Raspberry Pi 4. So far things go ok, apart from the following.
After the system has started I want a tunnel to be started via ssh.
This tunnel authenticates via key. This key has a password set (without is not an option).
When I fire up the tunnel from the commandline wihout terminal, a nice pop-up comes to ask the password. That's is ok. However, for convenience I want to start the tunnel automatically when the desktop is started.

So I created a dektop file, and placed that in .config/autostart

This kind of works. However the file is started during initialization of the desktop. I see the password box pop-up, and then being closed again as the initialization goes further until the desktop is shown.

Is there a way to make this file run áfter the desktop is visible?

Thnx for thinking with me.
Cheers,

One easy way would be to just add sleep to it. Maybe 5 seconds?

sleep 5 && sshcommandthing

Hmmmm.... that sounds very dirty.
If all else fails this might be worth an attempt, but I'ld prefer just place the command behind the entire start-up chain.

Maybe a service like this:

[Unit]
Description=Tunnel on top
After=network.target

[Service]
Type=idle
ExecStart=SSSSSSSSSSSHHHHHHH

[Install]
WantedBy=default.target

?

Behavior of idle is very similar to simple ; however, actual execution of the service program is delayed until all active jobs are dispatched. This may be used to avoid interleaving of output of shell services with the status output on the console. Note that this type is useful only to improve console output, it is not useful as a general unit ordering tool, and the effect of this service type is subject to a 5s timeout, after which the service program is invoked anyway.

lol... That too seems like a dirty trick. And I doubt it will do the job. 5 seconds is quite fast. So I doubt it is sufficient, Same goes for this one as for the previous suggestion. Will put it in: if all other things fail category.

But it should not be so hard to place some instruction on the end of the chain?

:thinking:

Don't agree?
My issue is that during the boot-up of the desktop a dialog which usually waits for user input is closed again due to an ongoing initialization. Now the question is: how do I make my job be executed later, after all initialization so the dialog can nicely wait for user input.

Both suggestions propose to add a sleep or waiting time, of which they hope will delay the closure of the dialog. This is not a solution (and answer of on my question) but merely a workaround.

I am pleased with the responses, thnx. But I'ld like to find a cause and solution.

No, it's not that!
I am just thinking if there is a cleaner way of doing what you want. That's all!

:wave:t3:

1 Like

According to this KISS person this is the most elegant systemd solution:


(though .. depending on how particular you are about it being last or waiting or what that might be relative to .. I still think just adding a single service the right way might be more 'elegant')

Forum kindly sponsored by