From 51cc3610b8f1397f312890a5309e38089bd1875f Mon Sep 17 00:00:00 2001
From: Htylol <dixperm909@yandex.ru>
Date: Tue, 29 Oct 2024 19:22:04 +0500
Subject: [PATCH] Added --pulsate for --progress

---
 data_from_portwine/scripts/functions_helper | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper
index 56ae97b6..d6709743 100755
--- a/data_from_portwine/scripts/functions_helper
+++ b/data_from_portwine/scripts/functions_helper
@@ -561,7 +561,7 @@ try_download () {
         curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
         -H 'Pragma: no-cache' -L ${FIRST_URL[@]} -o "$dest" 2>&1 | \
         tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
-        "$pw_yad" --progress --text="${translations[Downloading]} $filename" --auto-close --no-escape \
+        "$pw_yad" --progress --pulsate --text="${translations[Downloading]} $filename" --auto-close --no-escape \
         --auto-kill --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
         --window-icon="$PW_GUI_ICON_PATH/portproton.svg" --borders="$PROGRESS_BAR_BORDERS_SIZE"
     fi
@@ -572,7 +572,7 @@ try_download () {
             curl -f -# -A 'Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)' -H 'Cache-Control: no-cache, no-store' \
             -H 'Pragma: no-cache' -L ${SECOND_URL[@]} -o "$dest" 2>&1 | \
             tr '\r' '\n' | sed -ur 's|[# ]+||g;s|.*=.*||g;s|.*|#Downloading at &\n&|g' | \
-            "$pw_yad" --progress --text="${translations[Downloading]} $filename" --auto-close --no-escape \
+            "$pw_yad" --progress --pulsate --text="${translations[Downloading]} $filename" --auto-close --no-escape \
             --auto-kill --text-align="center" --fixed --no-buttons --title "PortProton" --width=500 --height=90 \
             --window-icon="$PW_GUI_ICON_PATH/portproton.svg" --borders="$PROGRESS_BAR_BORDERS_SIZE"
         fi
@@ -4161,6 +4161,8 @@ pw_stop_progress_bar () {
     if [[ -n ${PW_YAD_PID_PROGRESS_BAR_BLOCK[0]} ]] ; then
         local pid
         for pid in ${PW_YAD_PID_PROGRESS_BAR_BLOCK[@]} ; do
+            # Здесь sleep нужен, потому что pid может уже быть, но kill его не убьет
+            # со sleep 0.01 он делает 2 kill, c 0.02 нормально один
             while $(sleep 0.02) && [[ -f /proc/$pid/exe ]] ; do
                 kill -s SIGUSR1 "$pid" &>/dev/null
             done