Most of you might have noticed a cool feature which is available in Linux-Mint,
each time when you open a Terminal, it will display a cool - simple quote.
We don't have this option in Ubuntu. but we can have it.
First we have to install the Fortune Cookie Database in our system. we can do that by typing the following in a terminal.
sudo apt-get install fortune-mod cowsay
sudo apt-get install fortuneNow we have the database installed in our system. have a try by typing the following:
fortuneNow let us borrow a cool script from the Mint people.
open gedit (or any editor of your choice ) and type the following script in it and save it in /usr/bin/ by the name fortune.
#!/bin/bashRANGE=4number=$RANDOMlet "number %= $RANGE"case $number in0)cow="small";;1)cow="tux";;2)cow="koala";;3)cow="moose";;esac
RANGE=2number=$RANDOMlet "number %= $RANGE"case $number in0)command="/usr/games/cowsay";;1)command="/usr/games/cowthink";;esac
/usr/games/fortune | $command -f $cow
Now change the mode of this file to executable by typing the following in the terminal
sudo chmod +x /usr/bin/fortune
finally type the following in the terminal
sudo echo "/usr/bin/fortune" >> ~/.bashrc
Done !!! Now you will get a cool Fortune-Cookie , each time when you open the terminal...
Enjoy !! and Happy Hacking !!
Share this post :

Cool hacking, etta :)
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletewell, the script works..but when you open a bash console by typing sudo bash....you get an error
ReplyDeletecowthink: Could not find small cowfile!
ne ideas???
so Fortune which produces the quotes wants to use the /usr/share/cowsay/cows/small.cow file, but it does not exist.
ReplyDeleteas a temporary fix until the cowsay package is updated, do the following command in a terminal window:
sudo ln -s /usr/share/cowsay/cows/default.cow /usr/share/cowsay/cows/small.cow
This will make a symbolic link from the default.cow file, which appears to be the small cow to a link file named small.cow.