Skip to content

Commit

Permalink
Info on making fortune work
Browse files Browse the repository at this point in the history
  • Loading branch information
globalcitizen committed Jun 25, 2014
1 parent 9962b3b commit 845695e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions README.md
Expand Up @@ -11,17 +11,26 @@ After that, it should work fine.

There are two modes other than standard invocation, `--machine` which drops any
ANSI colors from the output, and `--fortune` which converts the wisdom to an
assumed imitation of the fortune format (untested, may need header/footer
massaging or character set tweaking).
assumed imitation of the fortune format. To make the resulting fortune format
file available to the classic `fortune` program (loses ANSI colors in output)
you can run `strfile` as follows:

To have it display on login, you could try something like this in your `.profile`:
```
taoup --fortune >taoup-fortunes
strfile taoup-fortunes taoup-fortunes.dat
fortune taoup-fortunes
```

To display `taoup` output at login, try something like this in your `.profile`:

```
/path/to/taoup |grep -v '^---' | while read line;do echo $RANDOM'|'$line;done |sort|cut -d"|" -f2- | head -n 1 | cowsay -f eyes -n |head -n 2 |tail -n 1
echo '' | cowsay -f eyes |tail -n 10 |sed 's/^//'
```

Note that you need to use the real source here, since the final `sed` contains
extended ANSI escape sequence characters that do not copy from Github-webland.
The `while read line...done` stuff is an ugly hack for portable random `sort`.
If you don't yet have `cowsay`, stop reading right now and get it installed!
Note that you need to use the real source of `README.md` for the command here,
since the final `sed` contains extended ANSI escape sequence characters that
do not copy from Github-webland. The `while read line...done` stuff is an
ugly hack for portable random `sort`, mostly for OSX users. If you don't yet
have `cowsay`, stop reading right now and get it installed!

0 comments on commit 845695e

Please sign in to comment.