mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Default themes argument
- This allows the function to be used from the shell as a shortcut to sourcing ~/.zshrc to load a new random theme - Refactor out list of all available themes
This commit is contained in:
parent
cfd683a991
commit
899d9d5ab3
2 changed files with 9 additions and 3 deletions
|
|
@ -86,7 +86,13 @@ function unlike_theme() {
|
|||
}
|
||||
|
||||
function load_random_theme() {
|
||||
themes=($*)
|
||||
# Default theme selection
|
||||
if [ $# -eq 0 ]; then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
else
|
||||
themes=($*)
|
||||
fi
|
||||
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue