From 109ca827b4a16bdcd3c003e5e128075e7cf559b7 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 20 Oct 2016 09:36:02 +1100 Subject: [PATCH] Fallbacks for the fortune display on logging in: just bail if fortune isn't available, and try alternatives if ponysay isn't available --- config/zsh/interactive+login/show_fortune | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/zsh/interactive+login/show_fortune b/config/zsh/interactive+login/show_fortune index 25891a8..c31874b 100644 --- a/config/zsh/interactive+login/show_fortune +++ b/config/zsh/interactive+login/show_fortune @@ -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