Skip to content

Uses neofetch to display random pokemon in the terminal when a new one is opened.

Notifications You must be signed in to change notification settings

Mgomez-01/pokefetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokefetch

Student Questions:

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

Dependencies

  • neofetch
  • jp2a
  • bash, shuf

Neofetch Directory

  • 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

Add to bashrc script Drop in

All pokemon with 5% shiny chance.

# 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

Only the Unknown with 5% shiny chance.

# 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

Wrapper for neofetch

# 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


}

Another version with fastfetch

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
}

Examples

./images/Mudkip_example.png

./images/Pikachu_example.png

About

Uses neofetch to display random pokemon in the terminal when a new one is opened.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages