Pokéshell

Posted on 2016-01-01 (Fri) in linux

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 ipopen 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 the package in the AUR.