For the student that asked about this project, I forgot to mention that the colors for the text at the bottom of the terminal comes from another project called Starship (https://starship.rs) I highly recommend it
- neofetch
- jp2a
- bash, shuf
- Contains all pokemon sprites in separate folders.
- Pokemon: contains all regular sprites
- shiny: contains the shiny ones
- Unknown: contains only Unknown
- shiny_unknown: contains the shiny Unknown
# Remember to change ~/Path/to/neofetch below to make this work as expected
POKEFETCH_PATH=~/Path/to/neofetch
POKE=$( [ $(( RANDOM % (101) )) -gt 95 ] && echo $POKEFETCH_PATH/shiny/`ls $POKEFETCH_PATH/shiny|shuf -n 1` || echo $POKEFETCH_PATH/Pokemon/`ls $POKEFETCH_PATH/Pokemon|shuf -n 1`)
neofetch --jp2a $POKE# Remember to change ~/Path/to/neofetch below to make this work as expected
POKEFETCH_PATH=~/Path/to/neofetch
POKE=$( [ $(( RANDOM % (101) )) -gt 95 ] && echo $POKEFETCH_PATH/shiny_unknown/`ls $POKEFETCH_PATH/shiny_unknown|shuf -n 1` || echo $POKEFETCH_PATH/Unknown/`ls $POKEFETCH_PATH/Unknown|shuf -n 1`)
neofetch --jp2a $POKE --colors 10 12 0 12 15# This is to wrap the function of Pokefetch to work a little smoother. The ability to provide the main path to images as an argument.
# Assumes the user gives a directory that contains Pokemon/ as well as shiny/. Now you can curate your own selection to display instead of all of them. call like pokefetch /Path/to/pngs %d
# %d as percentage of normal
pokefetch()
{
POKEFETCH_PATH=$1
NORMAL=`ls $POKEFETCH_PATH/Pokemon|shuf -n 1`
SHINY=`ls $POKEFETCH_PATH/shiny|shuf -n 1`
POKE=$( [ $(( RANDOM % (101) )) -gt $2 ] && echo $POKEFETCH_PATH/shiny/$SHINY || echo $POKEFETCH_PATH/Pokemon/$NORMAL)
neofetch --jp2a $POKE --colors 10 12 0 12 15
echo $NORMAL $SHINY
}In case you do not like how slow neofetch is to populate data in some cases, you could make use of fastfetch instead. It is faster to populate and works out just as well once you get used to the slight differences to neofetch.
pokefetch() {
POKEFETCH_PATH=$1
NORMAL=$(ls $POKEFETCH_PATH/Pokemon | shuf -n 1)
SHINY=$(ls $POKEFETCH_PATH/shiny | shuf -n 1)
POKE=$([ $((RANDOM % (101))) -gt $2 ] && echo $POKEFETCH_PATH/shiny/$SHINY || echo $POKEFETCH_PATH/Pokemon/$NORMAL)
# Convert image to ASCII using jp2a and store in a variable
ASCII_ART=$(jp2a --colors --width=60 $POKE)
# Use the ASCII art as the logo in Fastfetch
fastfetch --data "$ASCII_ART" --logo-type data
}
