This commit is contained in:
Brandon Sturgeon 2018-06-12 19:05:07 +00:00 committed by GitHub
commit 341961b013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View file

@ -103,12 +103,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"
else
source "$ZSH/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/$SELECTED_THEME.zsh-theme"
fi
fi
fi

View file

@ -6,6 +6,8 @@ export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# You may provide multiple theme names delimited by commas "," and one
# will be randomly selected each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"