sâmbătă, 28 ianuarie 2012

Spice Up Ubuntu/Linux Terminal With Quotes ( or motd) Each Time It Is Started

Terminal can be boring at times. What if we could add little fun factor to dull terminal? That is what I was wondering since last few days. On Ubuntu/Linux a dynamic message just like motd or to be precise a welcome message can be displayed each time you start a terminal instance even when in GUI mode ( whereas /etc/motd message is shown only on tty or at remote logins.)

For example, greeting like in following image each time you start terminal :

terminal-cowsay0

Installation :

We are going to use two programs namely “fortune” which generates random quotes and “cowsay” which adds some pictures with bubble over its head, just like in cartoons published in newspapers.

sudo aptitude install fortune cowsay


Configuration :

Sample run of “fortune | cowsay -n”

terminal-cowsay1


If you wish to see messages like above but random ones each time you start a new Terminal, you have to edit /etc/bash.bashrc file. Open it with root privileges,

gksudo gedit /etc/bash.bashrc

and add following lines at the end of the file

# Spicing up Terminal fortune | cowsay -n echo

Open new Terminal instance and the quote/motd should be displayed.


Further Customization :

If you want to have static greeting message, add following at the end of /etc/bash.bashrc file

# Spicing up Terminal cowsay YourTextHere echo

which produces :

terminal-cowsay2


cowsay comes with more fun pictures. The list can be found at /usr/share/cowsay/cows/

terminal-cowsay3


If you like any of above cartoons, then your modified line to be added in /etc/bash.bashrc file will be :

fortune | cowsay -n -f tux.cow

terminal-cowsay4

Get randomized cows each time:


Enjoy your new spicy Terminal!

Niciun comentariu:

Trimiteți un comentariu