mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-10 02:09:51 +00:00
Allow loading themes from predefined list
This commit is contained in:
@@ -94,7 +94,11 @@ unset config_file
|
||||
|
||||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]; then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
if [ "${(t)ZSH_THEME_RANDOM_CANDICATES}" = "array" ] && [ "${#ZSH_THEME_RANDOM_CANDICATES[@]}" -gt 0 ]; then
|
||||
themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDICATES}.zsh-theme)
|
||||
else
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
fi
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
|
||||
Reference in New Issue
Block a user