mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Merge 58c0fa2c5c into 09fbc16366
This commit is contained in:
commit
341961b013
2 changed files with 15 additions and 6 deletions
19
oh-my-zsh.sh
19
oh-my-zsh.sh
|
|
@ -103,12 +103,19 @@ if [[ "$ZSH_THEME" == "random" ]]; then
|
||||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||||
else
|
else
|
||||||
if [ ! "$ZSH_THEME" = "" ]; then
|
if [ ! "$ZSH_THEME" = "" ]; then
|
||||||
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
|
# Split by commas and randomly select a theme
|
||||||
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
|
themes=("${(s/,/)ZSH_THEME}")
|
||||||
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
|
N=${#themes[@]}
|
||||||
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
|
((N=(RANDOM%N)+1))
|
||||||
else
|
SELECTED_THEME=${themes[$N]}
|
||||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
|
||||||
|
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
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ export ZSH=$HOME/.oh-my-zsh
|
||||||
|
|
||||||
# Set name of the theme to load. Optionally, if you set this to "random"
|
# 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.
|
# 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
|
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||||
ZSH_THEME="robbyrussell"
|
ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue