mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-27 03:05:39 +01:00
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:
parent
cea29ff7ce
commit
1ceb8eabc0
3 changed files with 21 additions and 29 deletions
6
themes/random.zsh-theme
Normal file
6
themes/random.zsh-theme
Normal 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..."
|
||||
Loading…
Add table
Add a link
Reference in a new issue