I have installed cowsay
and fortune
. I want to set my own talks or texts in cowsay
. But I can't configure it out. When I open terminal there is nothing from cowsay
. I want to show cowsay
when I start terminal.
But this works:
hash@ssl50:~$ cowsay -f tux "Carry on"
< carry on >
----------
\
\
.--.
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\
\___)=(___/
cowsay
command line with random cowfile:Result:
You can add this command line to end of your login profile script for seeing random
cowsay
in any terminal. Forbash
, you would need to put this line in~/.bashrc
.To make it also randomly choose between
cowsay
andcowthink
, you can do this:This allows to have a one-line solution with random cowfiles, instead of painstakingly extending the Linux Mint script.
Well, in Linux Mint there is a fun thing you could do: write a script to select a cow and display a message from fortune. I'll get to it later. Once you have the script, all you have to do is to execute it. As suggested before, edit your ~/.bashrc file and add at the end a line containing the path to your script. For example, if you have the script in your home folder and the script's filename is "cowscript", then you could add the following line at the end of your ~/.bashrc file:
Now, the script used in Linux Mint 9 is the following:
Basically, it will display a random cow (either small, tux, koala, or moose) and the message will be taken from fortune. Also, this script will execute wither cowsay or cowthink, the only difference being that cowthink will display a thinking cow instead of a talking cow.
Now, the fun thing is that you can modify the script to show more cows or to show different cows. To do that, you first need to know what cows you have installed. In a terminal, run:
You can use any of those cows. All you have to do is to edit the script: if you want to add a new cow, just copy the lines containing "cow" (plus the number and semi-colons) and paste them before the line that says "esac". Then, change the number and name of the cow, so for instance, if you want to add a cow called "udder", all you have to do is to add these lines before the first "esac":
Important: the second line of the file, "RANGE=4", must be changed also. If you add one cow, then instead of 4 use 5, also if you delete one cow, then you must use 3, and so on. Also note that the numbers that you see must be in the range from 0 to RANGE - 1. That's why RANGE is 4 and the numbers are 0, 1, 2, and 3.
You could also create your own cows, although that might take a bit more of work. All you have to do is to get any ASCII art you like and edit it, but it is a bit tricky. You can see how it's done here: http://lmpeiris.wordpress.com/2011/01/17/cowsayhow-to-make-a-cow-talk-on-terminal-startup/ However, consider that any @ and \ symbols need to be backslashed, that is, you must put before that symbol this other symbol: \. This might be the case for #, too (but not always). If your ASCII Art contains #, you could backslash it too, but sometimes it would be enough with just one of them... I'm not sure how to explain it, sorry. I guess you will have to try to see if it works. Also, make sure that the file you edit has the extension ".cow"
Finally, once you have your own cows, you can either add them to the default location (you probably will need to be superuser for that) at /usr/share/cowsay/cows, or you could add to your ~/.bashrc file this lines:
Be sure to add those lines before you call your "cowscript". This also assumes that you have a folder called "cowfiles" on your home folder. Change the path if you want so it points to the folder where you have your cowfiles.
If you want to combine
cowsay
andfortune
to present you with a message each time you start a terminal, add the following line:to the file
.bashrc
in your home folder.I used the first two answers and the man page to get a turtle's random thought's.
cowsay -l
switch to list all of the cowfiles.After finding the turtle, I edited my
~/.bashrc
.P.S. I suggest that your first step is.
That way you will have plenty of fortunes. These fortunes also come in handy if you have "Wanda the wise Gnome fish" installed / possibly set to autoRun.
Also a great fortune set is the mint fortunes-husse.deb package. So either find the .deb file on-line via a quick Google or add the Mint repositories to Ubuntu.