Watch
1
0
Fork
You've already forked www.xengi.de
0
www.xengi.de/content/software/pokeshell.md
Ricardo (XenGi) Band 3518739961
new structure
2025-02-18 21:17:23 +01:00

1.3 KiB

title date category tags slug
Pokéshell 2016-01-01 23:30 software pokemon, shell, bash, fish, imagemagick, aur pokeshell

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.