Skip to content

Instantly share code, notes, and snippets.

@eduherraiz
Last active June 23, 2017 08:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduherraiz/c19f35ff5783b2eb3e6843363fe7c772 to your computer and use it in GitHub Desktop.
Save eduherraiz/c19f35ff5783b2eb3e6843363fe7c772 to your computer and use it in GitHub Desktop.
Git hook to show a random fortune message using random cowsay on fridays
#!/bin/bash
# System Dependencies
# sudo apt install fortune cowsay toilet
if [[ $(date +%u) -eq 5 ]] ; then
MESSAGE='FRIDAY AT APSL'
COW_STATUS=`shuf -n1 -e b d g p s t w y`
COWFILES=`cowsay -l | grep -v files`
COWFILE=`shuf -n1 -e $COWFILES`
echo "-- $MESSAGE --" | toilet --gay -f future
fortune -s -n 80 fortunes | cowsay -$COW_STATUS -f $COWFILE | toilet --gay -f term
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment