Prusa_i3_Slic3r_Config/post.sh
2020-01-13 14:02:42 +00:00

14 lines
396 B
Bash
Executable File

#!/bin/bash
LAYER_COUNT=`grep "^M117 Layer" "$1" -c`
LAYER_COUNT=`expr $LAYER_COUNT - 1`
INFO_TEXT=`grep -E ';.*(filament used|width)' "$1"`
FILIMENT_USED=`grep "filament used" "$1" | sed -e 's/.*= //'`
sed -ri "s|^M117 Layer ([0-9]+)|M117 Layer \1/$LAYER_COUNT|" "$1"
sed -ri "s|\[filament_used\]|$FILIMENT_USED|" "$1"
umount /media/bob/C2E8-6B89/
/usr/bin/zenity --info --text "$INFO_TEXT"