Skip to content

Renowned Japanese poetry anthologies, now in an easy to use form with the fortune command.

License

Notifications You must be signed in to change notification settings

Davidy22/Japanese-Fortunes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner Fortunes for use with the fortune program, a unix tool for displaying a random message.

$ fortune
藤原興風
百人一首三十四
誰をかも
知る人にせむ
高砂の

松もむかしの
友ならなくに

The anthologies contained:

All texts courtesy of the University of Virginia library.

Install

First you need fortune or a fortune equivalent installed.

Debian/Ubuntu

sudo apt-get install fortune

OSX

brew install fortune

Install the fortunes by running:

cd Japanese-Fortunes
chmod +xX INSTALL.sh
sudo ./INSTALL.sh

Terminal greetings

You can use some extra tools to frame the fortune for a pretty terminal greeting. You can install them with:

Debian/Ubuntu

sudo apt-get install par boxes

OSX

brew install par boxes

And then add the following line to your .bashrc/.zshrc/other terminal startup file:

fortune | par -w 150 -d -t | boxes -d scroll-akn | boxes -s $COLUMNS -c x -a hc -i none | cut -c 2-

Which will make something like this greet you at the top of the terminal when you open one up:

                                      /"\/\_..---------------._/\/"\
                                     (     _|| 藤原敏行朝臣  ||_     )
                                      \_/\/ || 百人一首十八  || \/\_/
                                            || 住の江の    ||
                                            || 岸による波   ||
                                            || よるさへや   ||
                                            ||         ||
                                            || 夢の通ひ路   ||
                                            || 人目よくらむ  ||
                                      /"\/\_|----------------|_/\/"\
                                     (     _|                |_     )
                                      \_/\/ `----------------' \/\_/

Adjusting

fortune will display any fortune on your computer, including any you may already have installed. fortune -f will give the ratio and odds, of an item from each source being selected. If you don't have any other fortunes installed, you should see:

2.17% /usr/share/games/fortunes/hyakunin
97.83% /usr/share/games/fortunes/manyoshu

Files with more fortunes are more likely to get selected. If you want all files to have equal selection odds, use fortune -e:

50.00% /usr/share/games/fortunes/hyakunin
50.00% /usr/share/games/fortunes/manyoshu

About

Renowned Japanese poetry anthologies, now in an easy to use form with the fortune command.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published