Lolcat

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

Lolcat is a funny terminal colorizer written in Ruby.

Installation

Accept the unstable keyword.

FILE /etc/portage/package.accept_keywords
games-misc/lolcat ~amd64

Emerge

Install games-misc/lolcat:

root #emerge --ask games-misc/lolcat

Tweaking

It is funny to add this to your ~/.bashrc, if you wish to lolcat all the time:

FILE ~/.bashrc
alias cat="lolcat"
Warning
Adding this to other people's your .bashrc however might cause unexpected side effects, use with caution!

Usage

There are many use cases; Here are a few ways to take advantage of it:

user $find /usr/portage -type f -exec lolcat '{}' \;
user $find /var/cache/man -type f -exec lolcat '{}' \;
user $fortune | cowsay | lolcat
user $tcpdump | lolcat
user $emerge --info | lolcat
user $cat /dev/urandom | base64 -w $COLUMNS | lolcat
Note
All emerge commands can be lolcatted. Use wisely.

You can have a nice fortune every time you open a shell with a random cow:

FILE ~/.bashrc
cow_mode[1]="-b"
cow_mode[2]="-d"
cow_mode[3]="" # default
cow_mode[4]="-g"
cow_mode[5]="-p"
cow_mode[6]="-s"
cow_mode[7]="-t"
cow_mode[8]="-w"
cow_mode[9]="-y"

rng=$(( $RANDOM % 9 + 1))

IFS=' '
cowfiles=(`cowsay -l | sed 1d | paste -sd " "`)
num_files=${#cowfiles[*]}
cowfile=${cowfiles[$((RANDOM % num_files))]}

fortune | cowsay -W 35 ${cow_mode[$rng]} -f $cowfile | lolcat

Examples

External resources