mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Random theme function can pick themes from favourite list
This commit is contained in:
parent
757fa3314d
commit
e5b9f0043a
1 changed files with 12 additions and 1 deletions
13
oh-my-zsh.sh
13
oh-my-zsh.sh
|
|
@ -43,7 +43,18 @@ for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
|
|||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]
|
||||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
if [ -z $ZSH_FAVLIST ]
|
||||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
else
|
||||
content=(`cat $ZSH_FAVLIST`)
|
||||
i=1
|
||||
for theme in $content
|
||||
do
|
||||
themes[$i]=$ZSH/themes/$theme.zsh-theme
|
||||
((i=i+1))
|
||||
done
|
||||
fi
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue