Last active
January 30, 2023 02:48
-
-
Save angstbear/a0499e955ecf282c06c4a7dd9cb8bd35 to your computer and use it in GitHub Desktop.
fortune + cowsay (random animal) + lolcat Fish-Shell prompt greeting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks)