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:
@@ -226,12 +226,14 @@ agm_progressbox() {
|
||||
local text="$2"
|
||||
|
||||
if [[ "$dialogType" == "yad" ]]; then
|
||||
# Use a text-info dialog that auto-closes when command finishes
|
||||
# This is more accessible than progress bars for screen readers
|
||||
{
|
||||
cat
|
||||
echo "=== Operation completed ==="
|
||||
} | yad --text-info \
|
||||
# Use a text-info dialog with improved real-time output display
|
||||
# Force line buffering and use named pipe for better responsiveness
|
||||
local tmpPipe
|
||||
tmpPipe=$(mktemp -u)
|
||||
mkfifo "$tmpPipe"
|
||||
|
||||
# Start yad in background reading from the pipe
|
||||
yad --text-info \
|
||||
--title="$title" \
|
||||
--text="$text" \
|
||||
--width=600 \
|
||||
@@ -239,7 +241,25 @@ agm_progressbox() {
|
||||
--timeout=1 \
|
||||
--timeout-indicator=bottom \
|
||||
--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
|
||||
dialog --title "$title" \
|
||||
--progressbox "$text" 20 70
|
||||
|
Reference in New Issue
Block a user