this post was submitted on 17 May 2025
8 points (83.3% liked)

Arch Linux

8753 readers
1 users here now

The beloved lightweight distro

founded 5 years ago
MODERATORS
 

I try to download a file with curl directly after logging into Gnome. This usually fails because mostly the WiFi connection is only established after login. If I wait long enough in the login screen before logging in, the connection is already established and the download works.

So far I have used Manjaro. WiFi was already active long before the login screen of GDM was even displayed. The download therefore always worked.

The download is initiated with a *.desktop file in ~/.config/autostart.

Is there another way to start the download after the user is logged in and the WiFi connection is really ready?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] harsh3466@lemmy.ml -1 points 4 weeks ago (1 children)

Easiest way would be to just add a sleep 15 command at the top of the script. Time how long it takes your wifi to come up, and adjust the sleep time with like a 2-3 second buffer in case it takes linger for some reason.

More exact would be to create a systemd service for your script that depends on network connectivity to execute.

[โ€“] MoLoPoLY@discuss.tchncs.de -1 points 4 weeks ago

Yep, I know. But when I only depend on

After=network-online.target
Wants=network-online.target

this doesn't mean, I have a working internet connection. That's why the loop.

Or is that wrong?