Sunday, February 6, 2011

Fortune for you!!

Almost all linux users are familiar with the fortune program. For new users, here is a small snippet:

fortune - print a random, hopefully interesting, adage

Description from the man page:
When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories.

Well, in order to fully utilize the program, I went ahead and wrote a small script that automatically displayed a random fortune everytime I logged in. Here is the script and all it requires is the notification daemon to be installed for your particular wm.

sleep 3
notify-send "Hello $(whoami), Your Daily Fortune..." "$(fortune)"

Save it as and mark it as executable by:

chmod +x

and just add it to the post login scripts in your particular wm, openbox in my case so '~/.config/openbox/'

No comments: