Attempt to improve progress details output during things like game installation. may have to revert this one, have to wait and see.

This commit is contained in:
Storm Dragon
2025-08-06 00:28:41 -04:00
parent 9b17248222
commit 6351d88676

View File

@@ -226,12 +226,14 @@ agm_progressbox() {
local text="$2" local text="$2"
if [[ "$dialogType" == "yad" ]]; then if [[ "$dialogType" == "yad" ]]; then
# Use a text-info dialog that auto-closes when command finishes # Use a text-info dialog with improved real-time output display
# This is more accessible than progress bars for screen readers # Force line buffering and use named pipe for better responsiveness
{ local tmpPipe
cat tmpPipe=$(mktemp -u)
echo "=== Operation completed ===" mkfifo "$tmpPipe"
} | yad --text-info \
# Start yad in background reading from the pipe
yad --text-info \
--title="$title" \ --title="$title" \
--text="$text" \ --text="$text" \
--width=600 \ --width=600 \
@@ -239,7 +241,25 @@ agm_progressbox() {
--timeout=1 \ --timeout=1 \
--timeout-indicator=bottom \ --timeout-indicator=bottom \
--button="Close:0" \ --button="Close:0" \
--tail --tail \
--auto-scroll \
--filename="$tmpPipe" &
local yadPid=$!
# Process input and write to pipe with unbuffered output
{
stdbuf -oL cat
echo "=== Operation completed ==="
} > "$tmpPipe" &
local catPid=$!
# Wait for either process to finish
wait $catPid 2>/dev/null
# Clean up
sleep 1 # Brief pause to ensure yad displays the completion message
kill $yadPid 2>/dev/null
rm -f "$tmpPipe"
else else
dialog --title "$title" \ dialog --title "$title" \
--progressbox "$text" 20 70 --progressbox "$text" 20 70