Skip to content

Instantly share code, notes, and snippets.

@bumbummen99
Last active January 30, 2020 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bumbummen99/dd1fab9884f3d5a2f881f18a122f4208 to your computer and use it in GitHub Desktop.
Save bumbummen99/dd1fab9884f3d5a2f881f18a122f4208 to your computer and use it in GitHub Desktop.
Bash script to show a customizeable text as ASCII art (Figlet) in every new terminal.
# First install figlet as this is required to render the text
sudo apt-get install figlet
# Add below lines to your ~./bashrc file. You can remove fonts from the list by adding an # in front of their entry.
# Create a data file if none does exist
if [[ ! -e ~/.terminal-welcome-message ]]; then
echo "Welcome" > ~/.terminal-welcome-message
fi
# Define available fonts (showfigfonts)
figlefonts[0]="banner"
figlefonts[1]="big"
figlefonts[2]="block"
figlefonts[3]="bubble"
figlefonts[4]="digital"
figlefonts[5]="ivrit"
figlefonts[6]="lean"
figlefonts[7]="mini"
figlefonts[8]="mnemonic"
figlefonts[9]="script"
figlefonts[10]="shadow"
figlefonts[11]="slant"
figlefonts[12]="small"
figlefonts[13]="smscript"
figlefonts[14]="smshadow"
figlefonts[15]="smslant"
figlefonts[16]="standard"
# Get the array size
size=${#figlefonts[@]}
# Get a random index
index=$(($RANDOM % $size))
# Render the text
figlet -f ${figlefonts[$index]} -p < ~/.terminal-welcome-message
# Open a new Terminal and enoy your "Welcome" message, you can override
# the default one in ~/.terminal-welcome-message and reset it by simply
# deleting the file and letting the script re-generate it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment