Ported over ui updates from Linux Game Manager.

This commit is contained in:
Storm Dragon
2025-08-06 15:47:59 -04:00
parent adfef6fba4
commit fa80331a63
3 changed files with 51 additions and 14 deletions

View File

@@ -54,9 +54,16 @@ download() {
# Skip if the item is in cache.
[[ -e "${cache}/${dest}" ]] && continue
if [[ "$dialogType" == "yad" ]]; then
# Use curl's progress bar with better accessibility for yad
if ! curl -L4 -C - --retry 10 --progress-bar --output "${cache}/${dest}" "${i}" 2>&1 | \
sed -u 's/.*\r\([0-9]*\)%.*/\1/' | agm_progress_with_percent "Audio Game Manager" "Downloading \"$dest\"..."; then
# Use curl's progress bar with better parsing for yad
if ! {
curl -L4 -C - --retry 10 --progress-bar --output "${cache}/${dest}" "${i}" 2>&1 | \
stdbuf -oL grep -o '[0-9]*%' | \
stdbuf -oL sed -u 's/%$//' | \
while read -r percent; do
echo "$percent"
echo "# Downloading $dest - ${percent}%"
done
} | agm_progress_with_percent "Audio Game Manager" "Downloading \"$dest\"..."; then
agm_infobox "Audio Game Manager" "Audio Game Manager" "Could not download \"$dest\". Installation cannot continue."
exit 1
fi