mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Merge 06c13633de into 397c085a19
This commit is contained in:
commit
3bdb058075
2 changed files with 16 additions and 3 deletions
11
oh-my-zsh.sh
11
oh-my-zsh.sh
|
|
@ -61,7 +61,18 @@ unset config_file
|
||||||
# Load the theme
|
# Load the theme
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
if [ "$ZSH_THEME" = "random" ]
|
||||||
then
|
then
|
||||||
|
if [ -z $ZSH_FAVLIST ]
|
||||||
|
then
|
||||||
themes=($ZSH/themes/*zsh-theme)
|
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=${#themes[@]}
|
||||||
((N=(RANDOM%N)+1))
|
((N=(RANDOM%N)+1))
|
||||||
RANDOM_THEME=${themes[$N]}
|
RANDOM_THEME=${themes[$N]}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,10 @@ FAVLIST="${HOME}/.zsh_favlist"
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
|
||||||
function noyes() {
|
function noyes() {
|
||||||
read "a?$1 [y/N] "
|
read "a?$1 [y/N/q] "
|
||||||
if [[ $a == "N" || $a == "n" || $a = "" ]]; then
|
if [[ $a == "q" || $a == "quit" ]] then
|
||||||
|
exit 0
|
||||||
|
elif [[ $a == "N" || $a == "n" || $a = "" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue