fortune is a simple program that displays random poignant, inspirational, silly or snide phrase from a database of quotations. The fortune command-line utility is part of the package.
Install or AUR.
- Meta packages which provide quotes from specific sources are available in the AUR under the prefix "fortune-mod-". For example, AUR contains Arch-related quotes.
- You can use wikiquote pages, using the syntax
wikiquote-fortune X, where
Xis the page's name. To use these files, run
$ fortune /path/to/quote. AUR to generate fortune files from
- 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:
#!/bin/bash # ~/.bashrc fortune
#!/bin/dash # ~/.dashrc fortune
- To display a random quote when logging into a login terminal, add the fortune command to the profile configuration file of your preferred shell:
#!/bin/mksh # ~/.profile fortune
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
fortune myquotes in a terminal. For this command to work you must be on the same directory as the
myquotes.dat files. If you want your quotes to be accessible by just running the
fortune 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.
See ASCII art#Cowsay.
See ASCII art#Ponysay.