-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpokefetch.sh
More file actions
executable file
·31 lines (25 loc) · 863 Bytes
/
Copy pathpokefetch.sh
File metadata and controls
executable file
·31 lines (25 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Make output directory if it doesn't already exist
mkdir -p output
# Prepend 10 blank lines for nice formatting next to image
echo > output/stats.txt
for ((i=0; i<9; i++));
do
echo >> output/stats.txt
done
# Get pokemon stats and output to file
/usr/bin/env python3 pokefetch.py $@ >> output/stats.txt
# Format input for image
POKEMON=$@ # '$@' refers to command line argument
POKEMON=${POKEMON[@]^} # This converts to Title Case
if [ $POKEMON == "Ho-oh" ] ; then
POKEMON="Ho-Oh"
# This won't work, need to handle space separated args eventualy
# For now just input names like Mr.Mime with no spaces
elif [ $POKEMON == "Mr. Mime" ] ; then
POKEMON="Mr.Mime"
fi
# Get image and output to file
catimg -w 120 "imgs/$POKEMON.png" > output/image.txt
# Print image and stats side by side
pr -mts output/image.txt output/stats.txt