Fortune

fortune is a simple program that displays random poignant, inspirational, silly or snide phrases from a database of quotations. The fortune command-line utility is part of the fortune-mod package.

Installation

Install fortune-mod or fortune-mod-gitAUR. Alternatively install misfortune, a fortune-mod clone written in haskell.

Tip:
  • Meta packages which provide quotes from specific sources are available in the AUR under the prefix "fortune-mod-". For example, fortune-mod-archlinuxAUR contains Arch-related quotes.
  • You can use wikiquote-fortuneAUR to generate fortune files from wikiquote pages, using the syntax wikiquote-fortune X, where X is the page's name. To use these files, run fortune /path/to/quote.

Usage

Command-line in a terminal:

$ fortune
It is Texas law that when two trains meet each other at a railroad crossing,
each shall come to a full stop, and neither shall proceed until the other has gone.

To display a random quote when launching an interactive terminal, add the fortune command to the rc configuration file of your preferred shell, for example:

~/.bashrc
#!/bin/bash
fortune
Note: fortune displays quotes and phrases deemed by its maintainer to be non-offensive. Aphorisms can be enabled as a mix of offensive/non-offensive or as potentially offensive output only. See fortune(6) for more information.

Creating custom files

In order to create a custom file, you must first create a file containing the quotes. Between each quote you must add a line containing only the % character. Save this file using whatever name you want, for example myquotes. Then, run strfile myquotes in a terminal, in order to enable random access of the quotes. You can now access the quotes by executing in a terminal. For this command to work you must be on the same directory as the and files. If you want your quotes to be accessible by just running the command, you must move both files into the /usr/share/fortune/ directory. If you want to make any changes to your file, repeat from the start.

Cowsay

See ASCII art#Cowsay.

Ponysay

See ASCII art#Ponysay.

gollark: I think the laws affecting it are somewhat at fault, though.
gollark: Indeed.
gollark: I mean, videos need lots of bandwidth and all, but if you don't expect more than a few people at a time to watch it it's not much of an issue.
gollark: You can just host videos yourself on a VPS/home server or something if you don't plan on high traffic and don't want its ad revenue/promotion.
gollark: The rules say "no talking about making it", not "no having pictures of exploding things".

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.