Fallbacks for the fortune display on logging in: just bail if fortune isn't available, and try alternatives if ponysay isn't available

This commit is contained in:
Danielle McLean 2016-10-20 09:36:02 +11:00
parent c8f970cc1a
commit 109ca827b4
No known key found for this signature in database
GPG key ID: CC91589719027E94

View file

@ -1,2 +1,4 @@
#! zsh
fortune $XDG_CACHE_HOME/sav-quotes/quotes | ponysay
(( $+commands[fortune] )) || return
for say in ponysay cowsay cat; (( $+commands[$say] )) && break
fortune $XDG_CACHE_HOME/sav-quotes/quotes | $say