From e5b9f0043a29196028787310d2ea24efec0e3248 Mon Sep 17 00:00:00 2001 From: volpino Date: Mon, 10 Oct 2011 16:53:55 +0200 Subject: [PATCH] Random theme function can pick themes from favourite list --- oh-my-zsh.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 891e8d467..58e3cbed0 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -43,7 +43,18 @@ for config_file ($ZSH_CUSTOM/*.zsh) source $config_file # Load the theme if [ "$ZSH_THEME" = "random" ] then - themes=($ZSH/themes/*zsh-theme) + if [ -z $ZSH_FAVLIST ] + then + themes=($ZSH/themes/*zsh-theme) + else + content=(`cat $ZSH_FAVLIST`) + i=1 + for theme in $content + do + themes[$i]=$ZSH/themes/$theme.zsh-theme + ((i=i+1)) + done + fi N=${#themes[@]} ((N=(RANDOM%N)+1)) RANDOM_THEME=${themes[$N]}