Welcome to the Terminal Cowsay Script repository! This simple script adds a touch of fun to your terminal experience by displaying a whimsical greeting in the form of a speech bubble from a .cow file every time you open the terminal.
- Displays an entertaining cowsay greeting upon each terminal opening.
-
Clone the repository:
git clone https://github.com/IlYAN-FISHERMAN/Cowsay_scrypt.git
-
Move the
.cowsay
folder to the same location as your.zshrc
file. -
Do
cowsay -l | grep "Cow files in *"
endcp
all your.cow
file in the path you get with the command. -
Add the following script to your
.zshrc
file:
#!/bin/bash
COWPATH="$COWPATH:$HOME/.cowsay/cowfiles/"
# Cow-spoken fortunes every time you open a terminal
function cowsayfortune
{
NUMOFCOWS=`cowsay -l | tail -n +2 | wc -w`
WHICHCOW=$((RANDOM%$NUMOFCOWS+1))
THISCOW=`cowsay -l | tail -n +2 | sed -e 's/\ /\'$'\n/g' | sed $WHICHCOW'q;d'`
#echo "Selected cow: ${THISCOW}, from ${WHICHCOW}"
fortune | cowsay -f $THISCOW -W 100
}
cowsayfortune
- Source your
.zshrc
file:source ~/.zshrc
Now, each time you open your terminal, you'll be greeted with a delightful cowsay message!
Ensure you have cowsay
and fortune
installed:
brew install cowsay && brew install fortune