added ability to override current themes from the custom directory

This commit is contained in:
Isman Firmansyah 2011-05-30 22:39:21 +07:00
commit 5fe395d35a

View file

@ -31,14 +31,18 @@ for config_file ($ZSH/custom/*.zsh) source $config_file
# Check for updates on initial load... # Check for updates on initial load...
if [ "$ZSH_THEME" = "random" ] if [ "$ZSH_THEME" = "random" ]
then then
themes=($ZSH/themes/*zsh-theme) themes=($ZSH/themes/*zsh-theme $ZSH/custom/themes/*zsh-theme)
N=${#themes[@]} N=${#themes[@]}
((N=(RANDOM%N)+1)) ((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]} RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME" source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else else
source "$ZSH/themes/$ZSH_THEME.zsh-theme" if [ -f $ZSH/custom/themes/$ZSH_THEME.zsh-theme ]; then
source $ZSH/custom/themes/$ZSH_THEME.zsh-theme
elif [ -f $ZSH/themes/$ZSH_THEME.zsh-theme ]; then
source $ZSH/themes/$ZSH_THEME.zsh-theme
fi
fi fi