diff --git a/fish/functions/motd.fish b/fish/functions/motd.fish index c9fce05..2d5936a 100644 --- a/fish/functions/motd.fish +++ b/fish/functions/motd.fish @@ -1,6 +1,11 @@ -function motd - if not command --search --quiet fortune ; echo "Error: function requires fortune" ; return 1 ; end - if not command --search --quiet cowsay ; echo "Error: function requires cowsay" ; return 2 ; end - if not command --search --quiet lolcat ; echo "Error: function requires lolcat" ; return 3 ; end - fortune | cowsay | lolcat +function motd --description "Message of the day!" + set --local daily_msg + + if contains -- '--chuck-norris' $argv + set daily_msg (curl -s 'https://api.chucknorris.io/jokes/random' | jq --raw-output '.value') + else + set daily_msg (fortune) + end + + cowsay $daily_msg end