add parameter check and fancy animations
This commit is contained in:
parent
4977816987
commit
8569917035
1 changed files with 54 additions and 7 deletions
|
@ -1,14 +1,61 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Inserting text"
|
||||
if [ -n "$1" ]; then
|
||||
echo "Generating Flaschenring for $1"
|
||||
else
|
||||
echo -e "No name given.\nUsage: generate_flaschenring.sh <Name>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
spin[0]="-"
|
||||
spin[1]="\\"
|
||||
spin[2]="|"
|
||||
spin[3]="/"
|
||||
|
||||
|
||||
sed "s/123456789/"$1"/g" flaschenring_template.svg > flaschenring_$1_temp.svg
|
||||
sleep 2
|
||||
echo "Text to path"
|
||||
sleep 0.1
|
||||
echo -n "[inserting] ${spin[0]}"
|
||||
until [ -f flaschenring_$1_temp.svg ]
|
||||
do
|
||||
for i in "${spin[@]}"
|
||||
do
|
||||
echo -ne "\b$i"
|
||||
sleep 0.1
|
||||
done
|
||||
done
|
||||
echo -ne "\bok"
|
||||
|
||||
inkscape --export-text-to-path -o flaschenring_$1_temp2.svg flaschenring_$1_temp.svg
|
||||
sleep 2
|
||||
echo "Delete path"
|
||||
sleep 0.1
|
||||
echo ""
|
||||
echo -n "[pathifying] ${spin[0]}"
|
||||
until [ -f flaschenring_$1_temp2.svg ]
|
||||
do
|
||||
for i in "${spin[@]}"
|
||||
do
|
||||
echo -ne "\b$i"
|
||||
sleep 0.1
|
||||
done
|
||||
done
|
||||
echo -ne "\bok"
|
||||
|
||||
|
||||
inkscape --batch-process --actions="select-by-id:textbasepath;delete" -o flaschenring_$1.svg --with-gui flaschenring_$1_temp2.svg
|
||||
sleep 2
|
||||
echo "Finished"
|
||||
sleep 0.1
|
||||
echo ""
|
||||
echo -n "[cleaning up] ${spin[0]}"
|
||||
until [ -f flaschenring_$1.svg ]
|
||||
do
|
||||
for i in "${spin[@]}"
|
||||
do
|
||||
echo -ne "\b$i"
|
||||
sleep 0.1
|
||||
done
|
||||
done
|
||||
echo -ne "\bok"
|
||||
|
||||
|
||||
|
||||
rm flaschenring_$1_temp.svg
|
||||
rm flaschenring_$1_temp2.svg
|
||||
|
|
Loading…
Add table
Reference in a new issue