kdrive: wait for an internet connection before attempting to mount

This commit is contained in:
2026-05-18 18:38:07 +02:00
parent 42dc5f8792
commit be9b959212
2 changed files with 219 additions and 211 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ in {
"swww img ${wallpaper}" "swww img ${wallpaper}"
"swww-daemon" "swww-daemon"
"sleep 1 && custom-wallpaper" "sleep 1 && custom-wallpaper"
"sleep 5 && custom-checkKdrive && custom-mountkdrive" # checks if the remote works and mount it "custom-checkKdrive && custom-mountkdrive" # checks if the remote works and mount it
#"waybar" #"waybar"
"custom-gitnotify" "custom-gitnotify"
"custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff "custom-checkMatrix" # checks if matrix-commander-rs is connected which is important for other stuff
+8
View File
@@ -13,6 +13,14 @@ writeShellApplication {
libnotify libnotify
]; ];
text = '' text = ''
# waits for an internet connection. It pings both Google DNS and Cloudfare dns in case one of them is down
until ping -c1 -W1 1.1.1.1 >/dev/null 2>&1 || \
ping -c1 -W1 8.8.8.8 >/dev/null 2>&1
do
sleep 1
done
set +e set +e
output=$(rclone lsd kdrive: 2>&1) output=$(rclone lsd kdrive: 2>&1)