mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-24 04:29:25 +02:00
add support for randomly selecting from a list of specific themes
This commit is contained in:
parent
656ddabcfa
commit
54fbbf9e48
2 changed files with 12 additions and 2 deletions
|
|
@ -92,6 +92,13 @@ for config_file ($ZSH_CUSTOM/*.zsh(N)); do
|
|||
done
|
||||
unset config_file
|
||||
|
||||
if [[ "$(declare -p ZSH_THEME) 2>/dev/null" =~ "(declare|typeset) -a" ]]; then
|
||||
# Choose randomly from multiple specified themes
|
||||
THEME_COUNT=${#ZSH_THEME[@]}
|
||||
((THEME_N=(RANDOM%THEME_COUNT)+1))
|
||||
ZSH_THEME=${ZSH_THEME[$THEME_N]}
|
||||
fi
|
||||
|
||||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]; then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@ export ZSH=$HOME/.oh-my-zsh
|
|||
|
||||
# Set name of the theme to load.
|
||||
# Look in ~/.oh-my-zsh/themes/
|
||||
# Optionally, if you set this to "random", it'll load a random theme each
|
||||
# time that oh-my-zsh is loaded.
|
||||
ZSH_THEME="robbyrussell"
|
||||
# Optionally, if you set this to "random", it'll load a random non-custom
|
||||
# theme each time that oh-my-zsh is loaded.
|
||||
# ZSH_THEME="random"
|
||||
# This can also be a list of specific themes to be chosen between at random
|
||||
# ZSH_THEME=(arrow gallifrey robbyrussell smt wedisagree)
|
||||
|
||||
# Uncomment the following line to use case-sensitive completion.
|
||||
# CASE_SENSITIVE="true"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue