Cowsay/cowthink (visit homepage at http://www.nog.net/~tony/warez/cowsay.shtml )

My hacked terminal startup using cowsay and figlet
Now you know what they use in Linux Mint to make a cow “talk” when the terminal starts
. I’m going to tell you how to do it in a much more awesome way. The programs they use are cowsay and fortune-mode. Cowsay can show any string, a text output of a command,program to appear as a dialog generated by an ascii art (including cow).
You can install program by
sudo apt-get install cowsay (in debian-based systems)
yum install cowsay (rpm based sytems)
Now try these in the terminal
cowsay “$USER is my boyfriend” ($ shows string value of environmental variable USER)
ls | cowsay (output of ls is piped to cowsay)
There are options to decide the appearance of the cow and its eyes. For example the switch -d will cause the cow to appear dead. But the most important hack can be done by -f which forces to use a files called cowsay files, so that we can get anything other than cow. Type
cowsay -l
to find the path of these files. Try each file with following syntax
cowsay -f <cowfile name, without extension> <string to display>
ex: cowsay -f tux $USER
The cowfiles can be edited to appear as we want. Only edit the stuff rounded by the circle. Do not edit anything else, and save by giving a different file name. Or we can simply download an ascii art from internet and replace the stuff in rounded area.

Editing a cowfile - only edit stuff on the red area
You can download ascii arts from sites like http://www.chris.com/ascii/ or simply you can build your own using these programs http://www.ascii-art.de/tools/. I’m not going to mention about them here. But the program Jave5 is a good one with a easy to use GUI, and runs on linux.
http://www.jave.de/download/download.html
Linux mint uses an additional program called fortune-mod to get’s stuff. Other than the command cowsay, cowthink can be used to appear like the cow is thinking, not speaking.
Fortune-mod (The classic fortune cookie program)
Fortune-mod is so far the funniest FOSS program i have come across with. It generates a random text string of a joke, a saying by a great person, something useful etc… Can’t be saying it all just try it by yourself. I haven’t seen the same thing twice after using it for some time.
Sudo apt-get install fortune-mod (for debian based systems)
yum install fortune-mod (for rpm based systems)
to use type fortune in the command line.
This can piped to above cowsay easily
ex: fortune | cowsay

a fortune | cowsay piped output
for other options of fortune, refer man pages.
Making the cow talk
To make this show on terminal startup (or run any program) you can put the above command in your bashrc file.
gedit ~/.bashrc
and add above commands, as you wish in it. You can add figlet command too. Open a new terminal to see the change.
So, mine produced something like the first picture in this post by these commands
cd ~/Desktop/figlet222/
./figlet -c -f script “lmpeiris rocks”
fortune | cowsay -f love
cd ~
Permalink
Leave a Comment
Mmmmm…….. it’s me after a long time writing on this blog. I’ve almost forgotten that there was a blog of mine just waiting to be refreshed by it’s author. Within the last year i changed my PC and the operating system twice, and now using the Fedora 14 x86/64 edition. So I guess we should start from some ascii arts on the terminal to show up whenever it’s started. This type art is familar to the Linux Mint users who will see an animal saying something in ascii art upon start of each terminal. However, it requires use of multiple commands. This post is part one.
Figlet – print a text as a logo http://www.figlet.org

Happy new year on figlet version 2.22
How to install – figlet is not provided with most of the Linux distributions, and it’s not included in their package hosting servers. Hence using yum or apt-get simply may not work. If that’s the case, we need to compile it from the source. You can download the source from here. Decompress it and change in to it’s directory in the terminal and type;
make
to compile figlet. For further information on compiling from source, see my article. Unfortunately, there’s no make install here so we need to change in to figlet directory always to use the command (you can copy the binaries and man pages in to correct directories but this is complex).
cd <path to figlet folder>/figlet222/
./figlet <the text you want to show as a logo>
figlet features
I’ ll be mentioning only the important ones here.
Change style/font : A sub directory called fonts holds some .flf files which contains style info.
./figlet -f <fontfile_name> text
ex: ./figlet -f script Happy new year will produce something like above picture.
change alignment : To center -c , -l for left and -r for right
change right to left: -R
layout: -t will fit the text to terminal width, -P paragraph mode

figlet using some tweaks above
There’s a lot more; see figlet man page for more details. http://www.figlet.org/figlet-man.html
Part 2 of the post is about using cowsay and fortune-mod. Will be followed soon.
Permalink
Leave a Comment