Skip to content

Instantly share code, notes, and snippets.

@angstbear
Last active January 30, 2023 02:48
Show Gist options
  • Save angstbear/a0499e955ecf282c06c4a7dd9cb8bd35 to your computer and use it in GitHub Desktop.
Save angstbear/a0499e955ecf282c06c4a7dd9cb8bd35 to your computer and use it in GitHub Desktop.
fortune + cowsay (random animal) + lolcat Fish-Shell prompt greeting
function fish_greeting
if not which fortune > /dev/null ^ /dev/null
switch (uname)
case Darwin
echo Installing fortune and cowsay
brew install fortune
sudo gem install lolcat
case Linux
echo Installing fortune and cowsay
if which apt-get > /dev/null ^ /dev/null
sudo apt-get install fortune cowsay
else
sudo yum install fortune cowsay
end
case '*'
echo Wait ... where are we\? (uname), eh
end
end
set -l toon (random choice {default,bud-frogs,dragon,dragon-and-cow,elephant,moose,stegosaurus,tux,vader})
if which lolcat > /dev/null ^ /dev/null
fortune -s | cowsay -f $toon | lolcat
else if which fortune > /dev/null ^ /dev/null
fortune -s | cowsay -f $toon
else
echo Something fishy going on around here ...
end
end
@VladPetriv
Copy link

thanks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment