Generate Automatic Motivational Phrases in Terminal

  2 mins read  

Was it Linux coaching? Not so much, there’s the offensive mode too! 😁️

Generate Automatic Motivational Phrases in Terminal

Introduction

fortune is a simple program that displays random, poignant, inspirational, silly or malicious phrases from a citation database. The fortune command line utility is part of the games-misc/fortune-mod package.

Installation

Fortune is available from the repository of all Linux distributions and all BSD. So to install use the same:

emerge fortune-mod # Gentoo, Funtoo, ...
sudo apt install fortune # Debian, Ubuntu, Mint, ...
sudo pacman -S fortune-mod # Arch, Manjaro,...
sudo yum install fortune # Red Hat, CentOS, ...
sudo dnf install fortune # Fedora

On BSDs it is already installed by default! :)

Use

To generate a sentence just run the command:

fortune

Some options:

  • fortune -a - generates all sorts of sentences: long, short, offensive;
  • fortune -o - only generates offensive phrases, for those who like! Observação (Note, in Gentoo and Funtoo, you need to compile with the flag USE="offensive" for offensives to appear);
  • fortune -l - only long sentences;
  • fortune -c - only short sentences;
  • fortune -m - Only phrases that contain at least one word that matches the regex you pass; For more options use the manual: man fortune

More options

  • 1 - If you want every time you open a terminal, a phrase appears, just add it to your echo 'fortune' >> ~/.bashrc or the Shell configuration file you use.
  • 2 - If you want a window to appear every time you log in. Example if it is in GNOME:
  • Create a phrase.desktop and use, for example, Yad and create a script with yad --title="Sentence of the day" --text="<big>$(fortune)</big>" which will be called by phrase.desktop and add it to start in the Startup Applications option.
  • 3 - Install other mods that display phrases: Star Wars, South Park, Simpsons, Linux Kernel and more!

Thanks!

Add our feed: https://en.terminalroot.com.br/feed to:

Feedly