Files
fileutils 083c18bca9 Screenshots for all 250 utilities; fix txnotify guard and benchcmd quoted command
- screenshots/: 250 terminal screenshot PNGs, one per bin/ utility
  (slices A-J), plus capture logs
- bin/txnotify: guard against missing termux-notification now exits
  instead of falling through to invoke the missing command
- bin/benchcmd: accept a single quoted command string
  (benchcmd -n 2 "echo hi") via shlex.split; selftest covers it
2026-12-04 04:17:53 +00:00

101 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
# Capture screenshots for util_box utilities 151-200 (slices G+H).
# Runs capture_one.py in parallel batches of 3.
set -u
cd /root/fileutils
LOG=/root/fileutils/screenshots/LOG-G-H.txt
: > "$LOG"
# --- sandbox setup ---
for n in txbattery txclip txnotify txstorage txvibrate txtorch txwifi txwallpaper txcontact txsms txcall txlocation txshare txopen txsensors txscan txbrightness txvolume txtts txdialog txwake txusb txtelephony txdownload txtermux datecalc epoch countdown stopwatch pomodoro unitconv dataconv tempconv passgen dice randpick randnum uuidgen colorpick morse braille baseconv romannum timesheet agecalc workdays tzconv speedconv currconv quote; do
mkdir -p "/tmp/shot-$n"
done
python3 -c "from PIL import Image; Image.new('RGB',(64,64),(30,60,120)).save('/tmp/shot-txwallpaper/wall.png')"
echo "hello from util_box" > /tmp/shot-txshare/note.txt
echo "hello from util_box" > /tmp/shot-txopen/note.txt
touch /tmp/shot-txscan/photo.jpg
B=/root/fileutils/bin
cap() {
local name="$1" cmd="$2" wd="/tmp/shot-$1"
if python3 /root/fileutils/tools/capture_one.py "$name" "$cmd" "$wd" "/root/fileutils/screenshots/$name.png" >/dev/null 2>&1; then
echo "$name | $cmd | ok" >> "$LOG"
else
echo "$name | $cmd | failed" >> "$LOG"
fi
}
run3() {
cap "$1" "$2" & cap "$3" "$4" & cap "$5" "$6" &
wait
}
run3 txbattery "$B/txbattery" \
txclip "$B/txclip get" \
txnotify "$B/txnotify -t 'Build done' -c 'lzply tests passed'"
run3 txstorage "$B/txstorage" \
txvibrate "$B/txvibrate 500" \
txtorch "$B/txtorch status"
run3 txwifi "$B/txwifi" \
txwallpaper "$B/txwallpaper --dry-run /tmp/shot-txwallpaper/wall.png" \
txcontact "$B/txcontact alice"
run3 txsms "$B/txsms -n 3" \
txcall "$B/txcall -n 3" \
txlocation "$B/txlocation --timeout 2"
run3 txshare "$B/txshare --dry-run /tmp/shot-txshare/note.txt" \
txopen "$B/txopen --dry-run /tmp/shot-txopen/note.txt" \
txsensors "$B/txsensors -l"
run3 txscan "$B/txscan --dry-run /tmp/shot-txscan/photo.jpg" \
txbrightness "$B/txbrightness status" \
txvolume "$B/txvolume"
run3 txtts "$B/txtts --dry-run 'Hello from util_box'" \
txdialog "$B/txdialog confirm -t 'Delete file?' --dry-run" \
txwake "$B/txwake status"
run3 txusb "$B/txusb" \
txtelephony "$B/txtelephony" \
txdownload "$B/txdownload --dry-run https://example.com/file.zip"
cap txtermux "$B/txtermux"
cap datecalc "$B/datecalc 2026-12-25 --diff 2027-01-01"
cap epoch "$B/epoch 1764720000"
run3 countdown "$B/countdown --once 2h" \
stopwatch "$B/stopwatch --duration 2" \
pomodoro "$B/pomodoro --work 0.1 --break 0 --cycles 1 --no-log"
run3 unitconv "$B/unitconv 100 cm" \
dataconv "$B/dataconv 1.5 GiB" \
tempconv "$B/tempconv 100 C"
run3 passgen "$B/passgen --length 20 --count 3 --seed 42" \
dice "$B/dice 3d6+2 --seed 42" \
randpick "$B/randpick apple banana cherry date --seed 7"
run3 randnum "$B/randnum 1 100 --count 5 --seed 42" \
uuidgen "$B/uuidgen --count 3" \
colorpick "$B/colorpick '#ff8800'"
run3 morse "$B/morse 'hello world'" \
braille "$B/braille hello" \
baseconv "$B/baseconv 255 2"
run3 romannum "$B/romannum 2026" \
timesheet "rm -f /tmp/shot-timesheet/log.json; $B/timesheet --file /tmp/shot-timesheet/log.json start coding; sleep 1; $B/timesheet --file /tmp/shot-timesheet/log.json stop --note 'first session'; $B/timesheet --file /tmp/shot-timesheet/log.json summary" \
agecalc "$B/agecalc 1990-06-15"
run3 workdays "$B/workdays 2026-12-01 2026-12-31" \
tzconv "$B/tzconv 09:00 America/New_York Asia/Tokyo" \
speedconv "$B/speedconv 100 km/h"
cap currconv "$B/currconv 100 USD EUR"
cap quote "$B/quote"
echo "DONE: $(grep -c '| ok$' "$LOG") ok, $(grep -c '| failed$' "$LOG") failed"