diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 689a79fef..8d1f2748a 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -61,7 +61,18 @@ unset 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]} diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 4d7047444..642a4b9a7 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -12,8 +12,10 @@ FAVLIST="${HOME}/.zsh_favlist" source $ZSH/oh-my-zsh.sh function noyes() { - read "a?$1 [y/N] " - if [[ $a == "N" || $a == "n" || $a = "" ]]; then + read "a?$1 [y/N/q] " + if [[ $a == "q" || $a == "quit" ]] then + exit 0 + elif [[ $a == "N" || $a == "n" || $a = "" ]]; then return 0 fi return 1