oizys/utils/generating-rune.sh

32 lines
628 B
Bash
Raw Normal View History

2023-01-19 07:11:16 -06:00
#!/usr/bin/env bash
set -e
2023-01-24 12:09:22 -06:00
declare -A IMG_SRC
IMG_SRC=(
[jeran]=https://upload.wikimedia.org/wikipedia/commons/0/01/Runic_letter_jeran.png
[othalan]=https://upload.wikimedia.org/wikipedia/commons/1/16/Runic_letter_othalan.png
)
2023-01-19 07:11:16 -06:00
2023-01-24 12:09:22 -06:00
if [[ $# -eq 0 ]]; then
echo please provide rune name
echo options:
for i in "${!IMG_SRC[@]}";do
echo $i
done
exit 1
fi
rune=$1
echo $2
color=${36:-$2}
# tmp this?
2023-01-19 07:11:16 -06:00
FILENAME="Runic_letter_${rune}.png"
2023-01-24 12:09:22 -06:00
wget -O $FILENAME "${IMG_SRC[$rune]}"
2023-01-19 07:11:16 -06:00
printf "\033[1;%dm\n%s\033[0m \033[1m%s\033[0m\n\n" \
"$color" \
2023-01-24 12:09:22 -06:00
"$(ascii-image-converter "$FILENAME" -n -H 10 -b)" \
2023-01-19 07:11:16 -06:00
"$rune" \
>"${rune}.txt"