Pokéshell

Posted on Fri 01 January 2016 in software

A friend of me had the idea of a shell displaying a random pokémon on launch. I liked the idea and couldn’t resist to implement it over christmas.

What the package does is, it downloads all pokémon images in a defined range which is 1-151 by default (I’m old these are the ones I know) and converts the images to escape sequences. These are saved in /usr/share/pokeshell.

Now when you open a new shell you could display one of them randomly by putting this code in your ~/.bashrc:

cat /usr/share/pokeshell/\$((\$RANDOM % 151 + 1)).pokemon

Or if you use fish like me put this in your ~/.config/fish/functions/fish_prompt.fish:

function fish_greeting
    set r (random)
    cat /usr/share/pokeshell/(math \"\$r % 151 + 1\").pokemon
end

The images are downloaded using the Pokéapi. For the conversation I use Imagemagick and a tool called img2xterm.

You can find a package for all of this in the AUR.