Random theme functionality encapsulated in a theme.

The statements for selecting a random theme in oh-my-zsh.sh and the themes plugin are duplicate. Most people eventually eventually settle on a theme, making those lines in oh-my-zsh.sh superfluous. To address those, it may make sense to put the random theme functionality into a theme of its own (since themes are just zsh-script).
This commit is contained in:
Willy Weiskopf 2014-07-16 22:21:09 -06:00
commit 1ceb8eabc0
3 changed files with 21 additions and 29 deletions

6
themes/random.zsh-theme Normal file
View file

@ -0,0 +1,6 @@
themes=($ZSH/themes/*zsh-theme)
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}
source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."