Adds ability to comma-delimit the ZSH_THEME variable
This commit is contained in:
parent
b908feebcf
commit
1a6593b55f
17
oh-my-zsh.sh
17
oh-my-zsh.sh
@ -102,12 +102,19 @@ if [ "$ZSH_THEME" = "random" ]; then
|
||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||
else
|
||||
if [ ! "$ZSH_THEME" = "" ]; then
|
||||
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
|
||||
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
|
||||
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
|
||||
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
|
||||
# Split by commas and randomly select a theme
|
||||
themes=("${(s/,/)ZSH_THEME}")
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
SELECTED_THEME=${themes[$N]}
|
||||
|
||||
if [ -f "$ZSH_CUSTOM/$SELECTED_THEME.zsh-theme" ]; then
|
||||
source "$ZSH_CUSTOM/$SELECTED_THEME.zsh-theme"
|
||||
elif [ -f "$ZSH_CUSTOM/themes/$SELECTED_THEME.zsh-theme" ]; then
|
||||
source "$ZSH_CUSTOM/themes/$SELECTED_THEME.zsh-theme"
|
||||
else
|
||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||
source "$ZSH/themes/$SELECTED_THEME.zsh-theme"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user