By Mark Vella-West on September 20, 2025
Beginner

SOURCE:  https://briannalaird.com/content/blog-posts/2025-01-17-using-figlet-and-lolcat.html


This guide will help you set up Figlet and Lolcat on Linux to create colourful, ASCII-styled terminal messages. I’ve provide detailed instructions for both Ubuntu and Arch-based systems.

Step 1: Install Figlet

Figlet is a tool for generating ASCII art from text. Use the appropriate commands based on your Linux distribution:

For Arch-based Systems (e.g., Arch, Manjaro):

sudo pacman -S figlet

Then do -

yay -S figlet-fonts

For Ubuntu-based Systems (e.g., Ubuntu, Debian):

sudo apt update
sudo apt install figlet figlet-data

Step 2: Install Lolcat

Lolcat adds vibrant rainbow colours to your terminal output, making your Figlet creations even more eye-catching.

For Arch-based Systems:

sudo pacman -S lolcat

For Ubuntu-based Systems:

sudo apt install lolcat

Step 4: Verify the Installation

Ensure everything is set up correctly:

  1. List Available Fonts:
figlist
  1. This command will display all of the available figlet font files on your system.
  2. Output all fonts to a txt file:
  3. To preview all of the available fonts, you can output them to a text file by running the following commands:
cd ~/Desktop
showfigfonts > figlet_fonts.txt
  1. This command will save the list of available figlet fonts to a text file named figlet_fonts.txt. Outputting to a txt file is a handy way to be able to preview all of the fonts available to you as there is a lot of them and your terminal may not be able to display them all at once. I’ve also added the output as a page if you’d like to view it all figlet fonts
  2. Test Figlet Output:
  3. Run the following to test Figlet:
figlet -f slant "Success"
  1. Combine Figlet with Lolcat:
  2. Add some colour to your output:
figlet -f slant "Success" | lolcat
  1. You should see a colourful ASCII-styled message in your terminal.
  2. alt text

Example Usage

Here are some examples to try:

  1. Custom Welcome Message:
figlet -f big "Welcome" | lolcat
  1. alt text
  2. Dynamic Output:
  3. Combine Figlet and Lolcat with other commands:
echo "Hello, $(whoami)!" | figlet | lolcat
  1. alt text

Trying Out Figlet and Lolcat together

Now that you have Figlet working, let’s enhance it with Lolcat’s colourful output.

  1. Basic Test:
figlet -f ansi_shadow "HI BREEZY" | lolcat
  1. This will display a vibrant, rainbow-colored message.
  2. alt text
  3. Lolcat Options Explained:
  4. Lolcat comes with a variety of options to customise the colour output:
  5. -a (Animation):
  6. Enables animated colouring that cycles through colours over time.
  7. Example:
figlet -f ansi_shadow "HI BREEZY" | lolcat -a
  1. (Video: First Animation)
  2. -d (Delay):
  3. Sets the delay in milliseconds for animated frames when -a is enabled.
  4. Example:
figlet -f ansi_shadow "HI BREEZY" | lolcat -a -d 5
  1. (Video: Delayed Animation)
  2. -F (Frequency):
  3. Adjusts the rainbow frequency. Lower values create smoother gradients.
  4. Examples:
figlet -f ansi_shadow "HI BREEZY" | lolcat -F 0.3
figlet -f ansi_shadow "HI BREEZY" | lolcat -F 0.5
figlet -f ansi_shadow "HI BREEZY" | lolcat -F 0.7
  1. (Image: Higher Frequency Gradient)
  2. Without Options:
  3. By default, lolcat applies a static rainbow gradient.
  4. Example:
figlet -f ansi_shadow "HI BREEZY" | lolcat
  1. (Image: Static Gradient)
  2. Creative Uses:
  3. Rainbow String:
echo "Hello, Breezy!" | lolcat
  1. Animate Directory Listing:
ls -la | lolcat -a -d 10
  1. Rainbow File Output:
cat yourfile.txt | lolcat -a -d 3

Customising Your Terminal

Using Figlet and Lolcat

Decide on the text you’d like to display, whether to use Lolcat, and which fonts and styles suit your preferences. For example, I chose the ANSI Shadow font and custom colours for my terminal setup. Here’s how you can add your own customisation:

  1. Open your terminal configuration file (e.g., .zshrc or .bashrc).
  2. Add the following line at the very beginning to display your message every time you open the terminal:
  3. (can change the message, font and lolcat options to whatever you’d like)
figlet -f ansi_shadow "HI BREEZY" | lolcat -F 0.3
  1. Save the file and restart your terminal to see the magic in action.

Here’s an example of how it looks when I first open my terminal:alt text

Using Figlet with Custom Colours

For a more personalised touch, you can use ANSI colour codes to apply specific colours to your Figlet output. Here’s how to preview and customise your terminal message with your favorite colours:

  1. Run the Following Script:
  2. This script uses a set of predefined ANSI colours to apply vibrant hues to Figlet text, cycling through them line by line:
# Define colors colors=( "\033[38;5;171m" "\033[38;5;135m" "\033[38;5;175m" "\033[38;5;141m" "\033[38;5;212m" ) # Generate Figlet text with ANSI Shadow font figlet_text=$(figlet -f ansi_shadow "HI BREEZY") # Split the Figlet text into lines (zsh-compatible) lines=("${(f)figlet_text}") # Apply colors to each line and print for i in {1..${#lines[@]}}; do color=${colors[$(( (i - 1) % ${#colors[@]} + 1 ))]}  # Cycle through colors echo -e "${color}${lines[i-1]}\033[0m"  # Reset color at the end done
  1. Here’s how the output will look:alt text
  2. Customise It:
  3. Replace ansi_shadow with your preferred Figlet font.
  4. Change the colours by updating the ANSI codes in the colours array. Use the colour chart below to pick your favorite shades.
  5. Preview Colours:
  6. Here’s an ANSI colour chart to help you choose:alt text
  7. Enjoy Your Setup:
  8. Save the script to a file or add it to your shell configuration to make your terminal display colourful, personalised messages every time it starts.



More articles on OS-Linux



More articles on OS-Linux
Comments

No comments yet.

Add a comment
Ctrl+Enter to add comment