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..."
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue