A customized macOS Terminal startup experience featuring:
- Centered Apple ASCII logo
- Dynamic Figlet welcome banner
- Random quote on every terminal session
- Cowsay-formatted quotes
- Rainbow gradients via
lolcat - ANSI-safe terminal centering
- Dynamic terminal-width detection
- Clean minimal Zsh prompt
Built specifically for macOS + Zsh.
- π Custom Apple ASCII logo
- π Rainbow gradient output
- π Dynamically centered content
- π₯οΈ Terminal-width detection
- π Resize-aware layout
- Large
figletbanner - Random short quote using
fortune -s cowsayquote formattinglolcatgradient coloring- Clean minimal prompt
The setup uses:
tput colsto detect terminal width- ANSI escape stripping before measuring text width
- Dynamic horizontal padding
- Color applied after centering
- No hardcoded terminal spacing
- Managed
.zshrcconfiguration - Safe re-running of the installation script
This setup is intended for:
- macOS
- Zsh
- Homebrew
If Homebrew is not already installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"brew install figlet fortune cowsay lolcat.
βββ README.md
βββ setup.sh
βββ .apple_logo
βββ .center
βββ preview.png
.apple_logoand.centerare also installed into your home directory as~/.apple_logoand~/.center.
The easiest way to install everything is with setup.sh.
chmod +x setup.sh./setup.shThe installer will:
- Install the required Homebrew packages.
- Create
~/.apple_logo. - Create
~/.center. - Make the centering script executable.
- Add the terminal startup configuration to
~/.zshrc. - Avoid adding duplicate configuration if the installer is run again.
After installation, restart Terminal or run:
source ~/.zshrcIf you prefer to configure everything yourself, follow the steps below.
Create:
nano ~/.apple_logoPaste your Apple ASCII art.
Make sure:
- There are no unnecessary empty lines at the beginning.
- The first character starts on the first line.
- The file contains only the ASCII artwork.
Save with:
CTRL + O
ENTER
CTRL + X
Create:
nano ~/.centerPaste:
#!/bin/bash
cols=$(tput cols)
strip_ansi() {
sed -E 's/\x1B\[[0-9;]*[mK]//g'
}
while IFS= read -r line; do
clean=$(printf '%s\n' "$line" | strip_ansi)
len=${#clean}
if [ "$len" -lt "$cols" ]; then
pad=$(( (cols - len) / 2 ))
printf "%*s%s\n" "$pad" "" "$line"
else
printf '%s\n' "$line"
fi
doneMake it executable:
chmod +x ~/.centerOpen your Zsh configuration:
nano ~/.zshrcAdd:
clear
cat ~/.apple_logo | ~/.center | lolcat
figlet "Likhit" | ~/.center | lolcat
fortune -s | cowsay | ~/.center | lolcat
export PS1="%F{cyan}%n@%m %F{yellow}%~ %F{green}β %f"Reload:
source ~/.zshrcThen open a new Terminal window or tab.
The terminal startup sequence works like this:
Terminal opens
β
.zshrc loads
β
Apple ASCII is generated
β
.center detects terminal width
β
ANSI escape sequences are removed
β
Text width is calculated
β
Horizontal padding is calculated
β
Content is centered
β
lolcat applies the gradient
β
Figlet banner is displayed
β
Random fortune is generated
β
Cowsay formats the quote
β
Quote is centered and colored
β
Minimal shell prompt appears
The important detail is that centering happens before lolcat adds color escape sequences.
This prevents ANSI escape codes from being incorrectly counted as visible characters.
Change:
figlet "Likhit"to:
figlet "YourName"For example:
figlet "Geeky Nads"Use:
figlet -f slant "Likhit"You can see available fonts with:
showfigfontsCurrent prompt:
export PS1="%F{cyan}%n@%m %F{yellow}%~ %F{green}β %f"Example:
export PS1="%F{red}%n@%m %F{blue}%~ %F{green}β %f"Make sure lolcat is applied after the centering operation.
Correct:
fortune -s | cowsay | ~/.center | lolcatAvoid:
fortune -s | cowsay | lolcat | ~/.centerThe second version can produce incorrect alignment because ANSI color escape sequences are included when calculating the line width.
Check the terminal width:
tput colsCheck that the centering script exists:
ls -l ~/.centerMake sure it is executable:
chmod +x ~/.centerCheck:
nano ~/.apple_logoRemove unnecessary blank lines before or after the artwork.
If you ran an older version of the installer multiple times, your .zshrc may contain duplicate startup commands.
Open:
nano ~/.zshrcRemove duplicate lines such as:
cat ~/.apple_logo | ~/.center | lolcat
figlet "Likhit" | ~/.center | lolcat
fortune -s | cowsay | ~/.center | lolcatThen reload:
source ~/.zshrcThe current setup.sh is designed to avoid creating duplicates.
macOS may display:
Last login: ...
To hide it:
touch ~/.hushloginTo restore it:
rm ~/.hushloginRemove the files created by the setup:
rm -f ~/.apple_logo
rm -f ~/.centerThen remove the Royal Terminal configuration from:
nano ~/.zshrcFinally reload:
source ~/.zshrcIf you no longer need the dependencies:
brew uninstall figlet fortune cowsay lolcatThis project modifies:
~/.zshrc
~/.apple_logo
~/.center
If you already have a customized .zshrc, review the changes made by
setup.sh before using it.
The setup is intended for macOS and Zsh.
Built by Likhit Midithana.
Designed for people who believe the terminal should look as good as the code running inside it.
