Skip to content

Instantly share code, notes, and snippets.

@sihil
Created August 7, 2025 11:38
Show Gist options
  • Save sihil/24a0ca14d5af9fbb1080db1d6035984c to your computer and use it in GitHub Desktop.
Save sihil/24a0ca14d5af9fbb1080db1d6035984c to your computer and use it in GitHub Desktop.
Wrapper script for gcode-cli to estimate remaining time
#!/bin/bash
set -e
FILE=${1}
if [ ! -f "${FILE}" ]; then
echo "File ${FILE} not found!"
exit 1
fi
# get the number of lines in the file
LINES=$(wc -l < "${FILE}")
# now plot with a progress bar
gcode-cli/gcode-cli "$FILE" /dev/ttyACM0,b115200 2>&1 | grep "<< OK" | pv -W -l -s "${LINES}" -pte > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment