mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Merge branch 'Random_Theme_From_List' of https://github.com/Gnouc/oh-my-zsh into Gnouc-Random_Theme_From_List
This commit is contained in:
commit
a1d13aa0b4
3 changed files with 21 additions and 2 deletions
|
|
@ -93,8 +93,12 @@ done
|
|||
unset config_file
|
||||
|
||||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]; then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
if [[ "$ZSH_THEME" == "random" ]]; then
|
||||
if [[ "${(t)ZSH_THEME_RANDOM_CANDIDATES}" = "array" ]] && [[ "${#ZSH_THEME_RANDOM_CANDIDATES[@]}" -gt 0 ]]; then
|
||||
themes=($ZSH/themes/${^ZSH_THEME_RANDOM_CANDIDATES}.zsh-theme)
|
||||
else
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
fi
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue