From 372a4d093000b88a35e281d9697e9bcef50658ca Mon Sep 17 00:00:00 2001 From: Fran Garcia Date: Thu, 19 Mar 2015 21:33:49 +0000 Subject: [PATCH] Allow user to blacklist themes from random selector. --- oh-my-zsh.sh | 4 ++++ templates/zshrc.zsh-template | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index bc7a8e496..5d294c33c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -81,6 +81,10 @@ unset config_file # Load the theme if [ "$ZSH_THEME" = "random" ]; then themes=($ZSH/themes/*zsh-theme) + for theme ($ZSH_BLACKLISTED_THEMES) do + themes=(${themes:#$ZSH/themes/${theme}.zsh-theme}) + done + N=${#themes[@]} ((N=(RANDOM%N)+1)) RANDOM_THEME=${themes[$N]} diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 763288dfd..735509ea3 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -4,8 +4,10 @@ export ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. # Look in ~/.oh-my-zsh/themes/ # Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. +# time that oh-my-zsh is loaded, except for themes included in +# ZSH_BLACKLISTED_THEMES ZSH_THEME="robbyrussell" +#ZSH_BLACKLISTED_THEMES=() # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true"