Skip to content

About

make your boring looking terminal look cool 😎

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

🍎 Royal macOS Terminal Setup

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.


πŸ“Έ Preview

Terminal Preview


✨ Features

🎨 Visual Design

  • 🍎 Custom Apple ASCII logo
  • 🌈 Rainbow gradient output
  • πŸ“ Dynamically centered content
  • πŸ–₯️ Terminal-width detection
  • πŸ”„ Resize-aware layout

πŸ’¬ Smart Greeting System

  • Large figlet banner
  • Random short quote using fortune -s
  • cowsay quote formatting
  • lolcat gradient coloring
  • Clean minimal prompt

βš™οΈ Technical Highlights

The setup uses:

  • tput cols to detect terminal width
  • ANSI escape stripping before measuring text width
  • Dynamic horizontal padding
  • Color applied after centering
  • No hardcoded terminal spacing
  • Managed .zshrc configuration
  • Safe re-running of the installation script

πŸ›  Requirements

This setup is intended for:

  • macOS
  • Zsh
  • Homebrew

1️⃣ Install Homebrew

If Homebrew is not already installed:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2️⃣ Install Dependencies

brew install figlet fortune cowsay lolcat

πŸ“ Project Structure

.
β”œβ”€β”€ README.md
β”œβ”€β”€ setup.sh
β”œβ”€β”€ .apple_logo
β”œβ”€β”€ .center
└── preview.png

.apple_logo and .center are also installed into your home directory as ~/.apple_logo and ~/.center.


πŸš€ Automatic Installation

The easiest way to install everything is with setup.sh.

Step 1 β€” Make the script executable

chmod +x setup.sh

Step 2 β€” Run the installer

./setup.sh

The installer will:

  1. Install the required Homebrew packages.
  2. Create ~/.apple_logo.
  3. Create ~/.center.
  4. Make the centering script executable.
  5. Add the terminal startup configuration to ~/.zshrc.
  6. Avoid adding duplicate configuration if the installer is run again.

After installation, restart Terminal or run:

source ~/.zshrc

🧰 Manual Installation

If you prefer to configure everything yourself, follow the steps below.

Step 1 β€” Create the Apple Logo

Create:

nano ~/.apple_logo

Paste 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

Step 2 β€” Create the Centering Script

Create:

nano ~/.center

Paste:

#!/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
done

Make it executable:

chmod +x ~/.center

⚑ Configure .zshrc

Open your Zsh configuration:

nano ~/.zshrc

Add:

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 ~/.zshrc

Then open a new Terminal window or tab.


🧠 How It Works

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.


🎨 Customization

Change the Banner

Change:

figlet "Likhit"

to:

figlet "YourName"

For example:

figlet "Geeky Nads"

Change the Figlet Font

Use:

figlet -f slant "Likhit"

You can see available fonts with:

showfigfonts

Change Prompt Colors

Current prompt:

export PS1="%F{cyan}%n@%m %F{yellow}%~ %F{green}➜ %f"

Example:

export PS1="%F{red}%n@%m %F{blue}%~ %F{green}➜ %f"

πŸ”§ Troubleshooting

πŸ„ Cow Looks Misaligned

Make sure lolcat is applied after the centering operation.

Correct:

fortune -s | cowsay | ~/.center | lolcat

Avoid:

fortune -s | cowsay | lolcat | ~/.center

The second version can produce incorrect alignment because ANSI color escape sequences are included when calculating the line width.


πŸ“ Content Is Not Centered

Check the terminal width:

tput cols

Check that the centering script exists:

ls -l ~/.center

Make sure it is executable:

chmod +x ~/.center

πŸ“ Large Vertical Gap

Check:

nano ~/.apple_logo

Remove unnecessary blank lines before or after the artwork.


🧹 Duplicate Startup Messages

If you ran an older version of the installer multiple times, your .zshrc may contain duplicate startup commands.

Open:

nano ~/.zshrc

Remove duplicate lines such as:

cat ~/.apple_logo | ~/.center | lolcat
figlet "Likhit" | ~/.center | lolcat
fortune -s | cowsay | ~/.center | lolcat

Then reload:

source ~/.zshrc

The current setup.sh is designed to avoid creating duplicates.


🀫 Disable the "Last Login" Message

macOS may display:

Last login: ...

To hide it:

touch ~/.hushlogin

To restore it:

rm ~/.hushlogin

πŸ—‘οΈ Uninstall

Remove the files created by the setup:

rm -f ~/.apple_logo
rm -f ~/.center

Then remove the Royal Terminal configuration from:

nano ~/.zshrc

Finally reload:

source ~/.zshrc

If you no longer need the dependencies:

brew uninstall figlet fortune cowsay lolcat

⚠️ Notes

This 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.


Credits

Built by Likhit Midithana.

Designed for people who believe the terminal should look as good as the code running inside it.

About

make your boring looking terminal look cool 😎

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors