Package: lfortune
FortuneProgram allows to play with fortunes files in a very similar way to the original "fortune" app
(https://en.wikipedia.org/wiki/Fortune_(Unix)); however, a few new features are planned!I have used "l" as a prefix for the console program version as the "fortune" name is already taken on PyPI.InstallationPyPIhttps://pypi.org/project/lfortune/For python3:pip install lfortuneor (when the python2 is also installed):pip3 install lfortuneYou will need to separately install the fortunes file(s) and appropriately configure the app (see below) - to point
where it can find these file(s).Docker imagehttps://hub.docker.com/r/lbacik/fortuneThere is set an automated build on dockerhub for the project's master branch. This build includes the debian's fortunes
package (stable release).docker run --rm lbacik/fortuneBuild the docker image locallygit clone git@github.com:lbacik/fortune.git
git checkout BRANCH
docker build -t fortune:local .UsagedockerIf you are using docker image - it already contains the fortune package, however, there is still a few packages/sets
which you can add/try - check theapt search fortune;).To get to bash prompt in docker image say:docker run --rm -ti --entrypoint=/bin/bash lbacik/fortunemacOSYou can install the original fortune's data files withbrew(of course it also contains the "fortune" program):brew install fortuneNext see the "configuration" section (below).otherYou can just clone the fortune data files from any of its repositories,
e.g:debian salsa reposhelpTo get help:1. when using docker image:docker run --rm lbacik/fortune --help2. when installed locally:$ lfortune --help         
usage: lfortune [-h] [-p [PATH]] [-c [CONFIG]] [--copy-config [COPY_CONFIG]] [--show-config] [--show-fortunes] 
                [db ...]

positional arguments:
  db                    fortunes db(s) - file(s)/directory(ies) (without root_path), optionally prepended with a
                        percentage chance of a hit, e.g: lfortune 50% computers art 40% tao (in this example art
                        will have 10%)

optional arguments:
  -h, --help            show this help message and exit
  -p [PATH], --path [PATH]
                        file/directory to get random fortune from (overrides the root_path, it can be also set as
                        FORTUNES environment variable)
  -c [CONFIG], --config [CONFIG]
                        config file to use
  --copy-config [COPY_CONFIG]
                        copy config file. You can provide the dest, the default is ~/.config/lfortune/config.ini
  --show-config         show settings and exit
  --show-fortunes       show fortunes (only the first positional argument is used)

2020 Łukasz Bacik <mail@luka.sh> https://github.com/lbacik/fortuneConfigurationThelfortuneapp (installed locally) will have to know where it can find the fortunes data files.
This information can be pass to the app on various ways:1. by the-pargumentLet assume we are using macOS, and you have installed the fortune files by thebrewcommand (brew install fortune).
You can check where they had been copied by:$ brew list fortune
/usr/local/Cellar/fortune/9708/bin/fortune
/usr/local/Cellar/fortune/9708/bin/strfile
/usr/local/Cellar/fortune/9708/bin/unstr
/usr/local/Cellar/fortune/9708/share/games/ (70 files)
/usr/local/Cellar/fortune/9708/share/man/ (3 files)

$ ls /usr/local/Cellar/fortune/9708/share/games/                                   
fortunes

$ ls /usr/local/Cellar/fortune/9708/share/games/fortunes  
... a lot of files...So, the fortune's data files can be found at/usr/local/Cellar/fortune/9708/share/games/fortunes,
in such a case you can get the random fortune by:$ lfortune -p /usr/local/Cellar/fortune/9708/share/games/fortunes2. by the environment variableThe env variable which the fortune app is looking for isFORTUNES:$ export FORTUNES=/usr/local/Cellar/fortune/9708/share/games/fortunes
$ lfortune3. by the config fileTo copy the config file to your home directory you can use:$ lfortune --copy-configThen the file is available at~/.config/lfortune/config.ini- you can set the fortune's data dir by setting
therootparameter.Exampleslfortunecan be always replaced by thedocker run --rm lbacik/fortune$ lfortune --show-config                                             
ConfigValues(root_path=/usr/local/Cellar/fortune/9708/share/games/fortunes)$ lfortune --show-fortunes 
PATH: /usr/local/Cellar/fortune/9708/share/games/fortunes
computers
riddles
men-women
literature
love
magic
linuxcookie
...$ lfortune --show-fortunes computers | tail
%
Your mode of life will be changed to ASCII.
%
Your mode of life will be changed to EBCDIC.
%
Your password is pitifully obvious.
%
Your program is sick!  Shoot it and put it out of its memory.
%Random generation from all the files in therootdirectory (and its subdirectories, what probably should be fixed):$ lfortuneRandom generation from the file:$ lfortune magic
"The first rule of magic is simple.  Don't waste your time waving your
hands and hoping when a rock or a club will do."
                -- McCloctnik the LucidSetting the percentage probability (linuxcookie will have had assigned the probability of 60%):$ lfortune 20% computers 20% magic linuxcookie
"I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs...It was very silly."
(By Matt Welsh)